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

[SCM] Debian package checker branch, master, updated. 2.2.10-84-gf11638a



The following commit has been merged in the master branch:
commit f11638a9e45d1cb62106218f11aa42df96d884f1
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Mon Jun 1 21:16:09 2009 +0100

    Warn about missing spaces between items in a dependency list
    
    * checks/control-file{,.desc}:
      + [ADB] Warn about missing spaces between items in a control file which
        have been omitted when spanning the dependency line over multiple
        lines.  Based on a patch by Damyan Ivanov.  (Closes: #516706)

diff --git a/checks/control-file b/checks/control-file
index fb62cdd..77a6ba5 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -105,6 +105,33 @@ for my $binary_control (@binary_controls) {
 	}
 }
 
+# Check if comma-separated values that span multiple lines omit commas as in
+# the following example:
+#   Depends: foo, bar
+#    baz
+for my $control ($header, @binary_controls) {
+	for my $field (qw(pre-depends depends recommends suggests breaks
+			  conflicts provides replaces enhances
+			  build-depends build-depends-indep
+			  build-conflics build-conflicts-indep)) {
+		next unless $control->{$field};
+		if ($control->{$field} =~ /
+			([^,]+)		# previous entry
+			\s*\n\s+	# new line + space
+			([a-z][^,]+)	# next entry, must start with a letter
+			/x) {
+
+			my ($prev, $next) = ($1, $2);
+			for ($prev, $next) {
+				s/^\s+//; s/\s+$//;
+			}
+			tag "missing-comma-between-items",
+			    "in $field field between '$prev' and '$next', " .
+			    ($control->{source} ? 'source' : $control->{package});
+		}
+	}
+}
+
 # Make sure that a stronger dependency field doesn't imply any of the elements
 # of a weaker dependency field.  dpkg-gencontrol will fix this up for us, but
 # we want to check the source package since dpkg-gencontrol may silently "fix"
diff --git a/checks/control-file.desc b/checks/control-file.desc
index efd4144..3f75157 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -142,6 +142,14 @@ Info: The given field in the <tt>debian/control</tt> file has a substvar
  the control file will have a syntax error.  You probably meant to put a
  comma after the substvar expansion.
 
+Tag: missing-comma-between-items
+Severity: important
+Certainty: certain
+Info: The given field in the <tt>debian/control</tt> file contains a list
+ of items separated by commas.  It appears that when wrapping the list on
+ multiple lines, a comma was missed at the end of a line.  This can lead
+ to bogus or incomplete dependencies, conflicts etc.
+
 Tag: package-depends-on-hardcoded-libc
 Severity: normal
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index a110d8d..fabe51f 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ lintian (2.2.11) UNRELEASED; urgency=low
 
   * Summary of tag changes:
     + Added:
+      - missing-comma-between-items
       - non-free-flash
       - section-area-mismatch
     + Removed:
@@ -22,6 +23,9 @@ lintian (2.2.11) UNRELEASED; urgency=low
       that source packages in main may build binary packages in contrib.
     + [RA] Skip duplicate description checks for udeb packages.  Thanks,
       Thijs Kinkhorst.  (Closes: #529924)
+    + [ADB] Warn about missing spaces between items in a control file which
+      have been omitted when spanning the dependency line over multiple
+      lines.  Based on a patch by Damyan Ivanov.  (Closes: #516706)
   * checks/cruft{,.desc}:
     + [RA] Downgrade certainty of tags for which we recommend overrides.
       Patch from Raphael Geissert.
diff --git a/t/tests/control-file-general/debian/debian/control.in b/t/tests/control-file-general/debian/debian/control.in
index 2e33cfc..5b48612 100644
--- a/t/tests/control-file-general/debian/debian/control.in
+++ b/t/tests/control-file-general/debian/debian/control.in
@@ -35,3 +35,15 @@ Description: {$description} (two)
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.
+
+Package: {$srcpkg}-3
+Section: {$section}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, foo
+  bar (>= 1), baz
+  (<< 2),
+  fizz (= 2.0)
+Description: {$description} (three)
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.
diff --git a/t/tests/control-file-general/desc b/t/tests/control-file-general/desc
index a0cae2b..230cdb2 100644
--- a/t/tests/control-file-general/desc
+++ b/t/tests/control-file-general/desc
@@ -8,7 +8,8 @@ Test-For:
  duplicate-long-description
  duplicate-short-description
  missing-comma-after-substvar
+ missing-comma-between-items
  no-section-field-for-source
  package-depends-on-itself
  stronger-dependency-implies-weaker
-References: Debian Bug#30020, Debian Bug#409099
+References: Debian Bug#30020, Debian Bug#409099, Debian Bug#516706
diff --git a/t/tests/control-file-general/tags b/t/tests/control-file-general/tags
index d44bdb7..179ce32 100644
--- a/t/tests/control-file-general/tags
+++ b/t/tests/control-file-general/tags
@@ -1,6 +1,7 @@
 E: control-file-general source: build-info-in-binary-control-file-section Package control-file-general
+E: control-file-general source: missing-comma-between-items in depends field between 'foo' and 'bar (>= 1)', control-file-general-3
 I: control-file-general source: binary-control-field-duplicates-source field "maintainer" in package control-file-general
-I: control-file-general source: duplicate-long-description control-file-general control-file-general-1 control-file-general-2
+I: control-file-general source: duplicate-long-description control-file-general control-file-general-1 control-file-general-2 control-file-general-3
 I: control-file-general source: duplicate-short-description control-file-general control-file-general-1
 W: control-file-general source: missing-comma-after-substvar in depends field near ${shlibs:Depends}
 W: control-file-general source: no-section-field-for-source

-- 
Debian package checker


Reply to: