[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.4-134-gb268e82



The following commit has been merged in the master branch:
commit b268e824d04227a67e7a258f853849f4612651f0
Author: Gergely Nagy <algernon@balabit.hu>
Date:   Tue Jan 24 10:30:28 2012 +0100

    Check for commented out collab-maint Vcs-* headers.
    
    dh_make adds commented out Vcs-* header boilerplate to debian/control,
    which should either be removed, or changed to be a valid location.
    
    This check implements just that.
    
    Modifications to the original patch:
     - tidied the regex a bit
     - renamed to tag control-file
     - only emit the tag once per file/package
    
    Requested-By: Paul Wise <pabs@debian.org>
    Signed-off-by: Gergely Nagy <algernon@balabit.hu>
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/control-file b/checks/control-file
index 1a6475b..2dccf73 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -52,10 +52,19 @@ if ($line) {
 
 # Check that each field is only used once:
 my $seen_fields = {};
+my $seen_vcs_comment = 0;
 open (CONTROL, '<', $dcontrol)
     or fail "Couldn't read debfiles/control: $!";
 while (<CONTROL>) {
     s/\s*\n$//;
+
+    if (m,^\# \s* Vcs-(?:Git|Browser): \s* (?:git|http)://git\.debian\.org/(?:\?p=)?collab-maint/<pkg>\.git,ox) {
+        # Emit it only once per package
+        tag 'control-file-contains-dh_make-vcs-comment'
+            unless $seen_vcs_comment++;
+        next;
+    }
+
     next if /^\#/;
 
     #Reset seen_fields if we enter a new section:
diff --git a/checks/control-file.desc b/checks/control-file.desc
index 189a4be..f902151 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -201,3 +201,10 @@ Info: The control file contains a syntax error.
  .
  This issue may hide other issues as Lintian skips some checks on the
  file in this case.
+
+Tag: control-file-contains-dh_make-vcs-comment
+Severity: normal
+Certainty: certain
+Info: The control file contains commented-out VCS-* lines, most
+ probably a result of dh_make. These URLs should either be valid and
+ uncommented, or removed.
diff --git a/debian/changelog b/debian/changelog
index dfa0a43..8c2062b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ lintian (2.5.5) UNRELEASED; urgency=low
 
   * Summary of tag changes:
     + Added:
+      - control-file-contains-dh_make-vcs-comment
       - dependency-is-not-multi-archified
       - dh-exec-install-not-allowed-here
       - dh-exec-private-helper
@@ -34,6 +35,9 @@ lintian (2.5.5) UNRELEASED; urgency=low
       to David Bremner for the report.  (Closes: #652602)
     + [NT] Emit a tag if there is a syntax error in d/control rather
       than just aborting the rest of the check.
+    + [NT] Accepted patch from Gergely Nagy to catch dh-make vcs
+      templates in comments.  Thanks to Paul Wise for suggesting this
+      check.  (Closes: #657110)
   * checks/cruft{,.desc}:
     + [NT] Added dh-autoreconf as a build-depends alternative to
       libtool for suppressing ancient-libtool warning.  Thanks to
diff --git a/t/tests/control-file-general/debian/debian/control.in b/t/tests/control-file-general/debian/debian/control.in
index 58e7522..e4f0cb6 100644
--- a/t/tests/control-file-general/debian/debian/control.in
+++ b/t/tests/control-file-general/debian/debian/control.in
@@ -11,6 +11,8 @@ Build-Depends: debhelper (>= 7.0.50~),
  ]
 Build-Depends-Indep: perl (> 5.8)
 XS-Vcs-Svn: svn://svn.example.com/{$srcpkg}/trunk
+#Vcs-Git: git://git.debian.org/collab-maint/<pkg>.git
+#Vcs-Browser: http://git.debian.org/?p=collab-maint/<pkg>.git;a=summary
 
 
 Package: {$srcpkg}
diff --git a/t/tests/control-file-general/desc b/t/tests/control-file-general/desc
index 99c6d58..100880e 100644
--- a/t/tests/control-file-general/desc
+++ b/t/tests/control-file-general/desc
@@ -5,6 +5,7 @@ Description: Various problems with debian/control
 Test-For:
  binary-control-field-duplicates-source
  build-info-in-binary-control-file-section
+ control-file-contains-dh_make-vcs-comment
  duplicate-long-description
  duplicate-short-description
  missing-separator-between-items
@@ -14,4 +15,5 @@ Test-For:
  stronger-dependency-implies-weaker
  xs-vcs-header-in-debian-control
 References: Debian Bug#30020, Debian Bug#409099, Debian Bug#516706,
- Debian Bug#533202, Debian Bug#557971, Debian Bug#573399, Debian Bug#580494
+ Debian Bug#533202, Debian Bug#557971, Debian Bug#573399, Debian Bug#580494,
+ Debian Bug#657110
diff --git a/t/tests/control-file-general/tags b/t/tests/control-file-general/tags
index 82fd675..0baad60 100644
--- a/t/tests/control-file-general/tags
+++ b/t/tests/control-file-general/tags
@@ -4,6 +4,7 @@ I: control-file-general source: binary-control-field-duplicates-source field "ma
 I: control-file-general source: duplicate-long-description control-file-general control-file-general-1 control-file-general-2 control-file-general-3 control-file-general-4
 I: control-file-general source: duplicate-short-description control-file-general control-file-general-1
 I: control-file-general source: xs-vcs-header-in-debian-control xs-vcs-svn
+W: control-file-general source: control-file-contains-dh_make-vcs-comment
 W: control-file-general source: no-section-field-for-source
 W: control-file-general source: obsolete-relation-form-in-source in control-file-general-1 breaks: libsqlite3-0 (< 3.6.12)
 W: control-file-general source: obsolete-relation-form-in-source in source build-depends-indep: perl (> 5.8)

-- 
Debian package checker


Reply to: