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

[SCM] Debian package checker branch, master, updated. 2.2.5-19-gc5446dc



The following commit has been merged in the master branch:
commit c5446dce204c8c59d74ac847ec8a0351ebc7cb89
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Sat Feb 14 22:02:54 2009 +0000

    Split Distribution: in .changes into individual distributions and check each
    
    Given a distribution of "stable unstable", don't issue bad-dist-in-changes,
    as each separate distribution is valid.  There will be a further tag added
    soon to indicate that Debian doesn't (or probably soon won't) accept this
    syntax.
    
    * frontend/lintian:
      + [ADB] Split the Distribution field of a .changes file into individual
        distributions and then check each of them against the list of known
        distributions.  (Closes: #514853)

diff --git a/debian/changelog b/debian/changelog
index d474f7f..4320d7f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,11 @@ lintian (2.2.6) UNRELEASED; urgency=low
     + [RA] New file listing known virtual packages.  Based on a patch by
       Raphael Geissert.  (Closes: #514497)
 
+  * frontend/lintian:
+    + [ADB] Split the Distribution field of a .changes file into individual
+      distributions and then check each of them against the list of known
+      distributions.  (Closes: #514853)
+
   * private/refresh-virtual-packages-data:
     + [RA] New script to generate the list of virtual packages.  Based on
       a patch by Raphael Geissert.
diff --git a/frontend/lintian b/frontend/lintian
index 04f3154..9718b7f 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -808,25 +808,28 @@ while (my $arg = shift) {
 	    if (defined $data->{distribution}) {
 		my $ubuntu_dists = Lintian::Data->new ('changelog-file/ubuntu-dists');
 		my $ubuntu_regex = join('|', $ubuntu_dists->all);
-		if ($data->{distribution} eq 'UNRELEASED') {
-		    # ignore
-		} elsif ($data->{version} =~ /ubuntu|$ubuntu_regex/
-			 or $data->{distribution} =~ /$ubuntu_regex/) {
-		    if ($data->{distribution} !~ /^($ubuntu_regex)(-(proposed|updates|backports|security))?$/ ) {
-			tag("bad-ubuntu-distribution-in-changes-file",
-			    $data->{distribution});
+		my @distributions = split /\s+/o, $data->{distribution};
+		for my $distribution (@distributions) {
+		    if ($distribution eq 'UNRELEASED') {
+			# ignore
+		    } elsif ($data->{version} =~ /ubuntu|$ubuntu_regex/
+			 or $distribution =~ /$ubuntu_regex/) {
+			if ($distribution !~ /^($ubuntu_regex)(-(proposed|updates|backports|security))?$/ ) {
+			    tag("bad-ubuntu-distribution-in-changes-file",
+				$distribution);
+			}
+		    } elsif (! (($distribution eq 'stable')
+				 or ($distribution eq 'testing')
+				 or ($distribution eq 'unstable')
+				 or ($distribution eq 'experimental')
+				 or ($distribution =~ /\w+-backports/)
+				 or ($distribution =~ /\w+-proposed-updates/)
+				 or ($distribution =~ /\w+-security/))
+			    ) {
+			# bad distribution entry
+			tag("bad-distribution-in-changes-file",
+			    $distribution);
 		    }
-		} elsif (! (($data->{distribution} eq 'stable')
-			 or ($data->{distribution} eq 'testing')
-			 or ($data->{distribution} eq 'unstable')
-			 or ($data->{distribution} eq 'experimental')
-			 or ($data->{distribution} =~ /\w+-backports/)
-			 or ($data->{distribution} =~ /\w+-proposed-updates/)
-			 or ($data->{distribution} =~ /\w+-security/))
-			) {
-		    # bad distribution entry
-		    tag("bad-distribution-in-changes-file",
-			$data->{distribution});
 		}
 	    }
 
diff --git a/t/tests/distribution-ubuntu-native/debian/debian/changelog.in b/t/tests/distribution-multiple-bad-distributions/debian/debian/changelog.in
similarity index 54%
copy from t/tests/distribution-ubuntu-native/debian/debian/changelog.in
copy to t/tests/distribution-multiple-bad-distributions/debian/debian/changelog.in
index 2731d63..626f331 100644
--- a/t/tests/distribution-ubuntu-native/debian/debian/changelog.in
+++ b/t/tests/distribution-multiple-bad-distributions/debian/debian/changelog.in
@@ -1,4 +1,4 @@
-{$srcpkg} ({$version}) jaunty; urgency=low
+{$srcpkg} ({$version}) stable foo bar unstable; urgency=low
 
   * Lintian Test Suite.
   * Test: {$testname}
diff --git a/t/tests/distribution-multiple-bad-distributions/desc b/t/tests/distribution-multiple-bad-distributions/desc
new file mode 100644
index 0000000..969b701
--- /dev/null
+++ b/t/tests/distribution-multiple-bad-distributions/desc
@@ -0,0 +1,7 @@
+Testname: distribution-multiple-bad-distributions
+Sequence: 2500
+Version: 1.0
+Test-For: bad-distribution-in-changes-file
+Description: Check *.changes distribution checking for multiple distributions
+  where at least one of them does not exist
+References: Debian Bug#514853
diff --git a/t/tests/distribution-multiple-bad-distributions/tags b/t/tests/distribution-multiple-bad-distributions/tags
new file mode 100644
index 0000000..1eca685
--- /dev/null
+++ b/t/tests/distribution-multiple-bad-distributions/tags
@@ -0,0 +1,2 @@
+E: distribution-multiple-bad-distributions_1.0_amd64.changes: bad-distribution-in-changes-file bar
+E: distribution-multiple-bad-distributions_1.0_amd64.changes: bad-distribution-in-changes-file foo

-- 
Debian package checker


Reply to: