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

[SCM] Debian package checker branch, master, updated. 2.5.6-51-g741c475



The following commit has been merged in the master branch:
commit 741c4758a0bd83a8bbcf0443a0cd622e56eea8f8
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Apr 3 00:55:59 2012 +0200

    changes-files: Use known-dists data file to validate dists
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/changes-file b/checks/changes-file
index 841fa15..ddbdd37 100644
--- a/checks/changes-file
+++ b/checks/changes-file
@@ -26,13 +26,7 @@ use Util;
 use Lintian::Tags qw(tag);
 use Lintian::Check qw(check_maintainer);
 
-my $DEBIAN_DISTS = Lintian::Data->new ('changes-file/debian-dists');
-my $UBUNTU_REGEX;
-{
-    my $ubuntu_dists = Lintian::Data->new ('changes-file/ubuntu-dists');
-    my $reg_str = join('|', $ubuntu_dists->all);
-    $UBUNTU_REGEX = qr/$reg_str/o;
-}
+my $KNOWN_DISTS = Lintian::Data->new ('changes-file/known-dists');
 
 sub run {
 
@@ -49,7 +43,7 @@ if (!$info->field('format')) {
 
 # Description is mandated by dak, but only makes sense if binary
 # packages are included.  Don't tag pure source uploads.
-if (!$info->field('description') && $info->field('architecture') ne 'source') {
+if (!$info->field('description') && ($info->field('architecture')//'') ne 'source') {
     tag 'no-description-in-changes-file';
 }
 
@@ -59,20 +53,17 @@ if (defined $info->field('distribution')) {
     for my $distribution (@distributions) {
         if ($distribution eq 'UNRELEASED') {
             # ignore
-        } elsif ($info->field('version') =~ m/ubuntu|$UBUNTU_REGEX/o
-            or $distribution =~ m/$UBUNTU_REGEX/o) {
-                if ($distribution !~ m/^(?:$UBUNTU_REGEX)(?:-(?:proposed|updates|backports|security))?$/o ) {
-                    tag 'bad-ubuntu-distribution-in-changes-file',
-                        $distribution;
-                }
-        } elsif (! ($DEBIAN_DISTS->known ($distribution)
-                     or ($distribution =~ /^\w+-backports$/)
-                     or ($distribution =~ /^\w+-proposed-updates$/)
-                     or ($distribution =~ /^\w+-security$/)
-                     or ($distribution =~ /^\w+-volatile$/))
-                ) {
-            # bad distribution entry
-            tag 'bad-distribution-in-changes-file', $distribution;
+        } else {
+            my $dist = $distribution;
+            if ($dist !~ m/^(?:sid|unstable|experimental)/) {
+                # Strip common "extensions" for distributions (except sid and
+                # experimental, where they would make no sense)
+                $dist =~ s/-(?:backports|proposed(?:-updates)?|updates|security|volatile)$//o;
+            }
+            if (! $KNOWN_DISTS->known ($dist)) {
+                # bad distribution entry
+                tag 'bad-distribution-in-changes-file', $distribution;
+            }
         }
     }
 
diff --git a/checks/changes-file.desc b/checks/changes-file.desc
index ec1391e..7ceb8d0 100644
--- a/checks/changes-file.desc
+++ b/checks/changes-file.desc
@@ -27,23 +27,15 @@ Tag: bad-distribution-in-changes-file
 Severity: important
 Certainty: certain
 Info: You've specified an unknown target distribution for your upload in
- the <tt>debian/changelog</tt> file.
+ the <tt>debian/changelog</tt> file.  It is possible that you are uploading
+ for a different distribution than the one Lintian is checking for.  In
+ that case, passing --vendor $VENDOR may fix this warning.
  .
  Note that the distributions <tt>non-free</tt> and <tt>contrib</tt> are no
  longer valid. You'll have to use distribution <tt>unstable</tt> and
  <tt>Section: non-free/xxx</tt> or <tt>Section: contrib/xxx</tt> instead.
 Ref: policy 5.6.14
 
-Tag: bad-ubuntu-distribution-in-changes-file
-Severity: important
-Certainty: certain
-Info: You've specified an unknown target distribution for your upload in
- the <tt>debian/changelog</tt> file.
- .
- Your version string suggests this package is for Ubuntu, so your
- distribution should be one of precise, oneiric, natty, maverick, lucid,
- karmic, hardy, or dapper.
-
 Tag: multiple-distributions-in-changes-file
 Severity: important
 Certainty: possible
diff --git a/debian/changelog b/debian/changelog
index 1e17e9c..9de145f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ lintian (2.5.7) UNRELEASED; urgency=low
     + Removed:
       - ancient-dpkg-long-filenames-check
       - ancient-dpkg-predepends-check
+      - bad-ubuntu-distribution-in-changes-file
       - binary-nmu-uses-old-version-style
       - debian-control-with-duplicate-fields
       - doc-base-file-references-usr-doc
@@ -29,6 +30,11 @@ lintian (2.5.7) UNRELEASED; urgency=low
     + [NT] Migrate to sorted_index from sorted_file_info.
   * checks/binaries:
     + [NT] Move embedded library data to a data file.
+  * checks/changes-file{,.desc}:
+    + [NT] Remove Ubuntu specific handling of distribution names.
+      Instead replace it with a more generalized one that derivatives
+      can reuse by extending vendor specific data files.
+      (Closes: #648777)
   * checks/deb-format{,.desc}:
     + [NT] Replace old udeb compression tag with a more general
       one.  (Closes: #664600)
@@ -82,6 +88,8 @@ lintian (2.5.7) UNRELEASED; urgency=low
     + [NT] New file.
     + [NT] Add libav libraries.  Thanks to Andres Mejia for the
       suggestion and the suggested patch.  (Closes: #666765)
+  * data/changes-file/{debian-dists -> known-dists}:
+    + [NT] Renamed file.
 
   * frontend/lintian:
     + [JW] Fix typo in error message.
@@ -121,6 +129,8 @@ lintian (2.5.7) UNRELEASED; urgency=low
     + [NT] Add a number of NMU related tags to the list of disabled
       tags.
 
+  * vendors/ubuntu/main/data/changes-file/known-dists:
+    + [NT] New file based on data/changes-file/ubuntu-dists.
   * vendors/ubuntu/main/data/common/source-fields:
     + [NT] New file.
   * vendors/ubuntu/main/data/fields/{binary,udeb}-fields:
diff --git a/t/changes/changes-bad-ubuntu-distribution.desc b/t/changes/changes-bad-ubuntu-distribution.desc
index e9d19c4..c78604b 100644
--- a/t/changes/changes-bad-ubuntu-distribution.desc
+++ b/t/changes/changes-bad-ubuntu-distribution.desc
@@ -2,5 +2,6 @@ Testname: changes-bad-ubuntu-distribution
 Sequence: 6000
 Version: 1.0+ubuntu2
 Description: Test for invalid Ubuntu distribution
+Profile: ubuntu/main
 Test-For:
- bad-ubuntu-distribution-in-changes-file
+ bad-distribution-in-changes-file
diff --git a/t/changes/changes-bad-ubuntu-distribution.tags b/t/changes/changes-bad-ubuntu-distribution.tags
index 1fbe5f8..25386e6 100644
--- a/t/changes/changes-bad-ubuntu-distribution.tags
+++ b/t/changes/changes-bad-ubuntu-distribution.tags
@@ -1 +1 @@
-E: changes-bad-ubuntu-distribution changes: bad-ubuntu-distribution-in-changes-file wispy
+E: changes-bad-ubuntu-distribution changes: bad-distribution-in-changes-file wispy
diff --git a/t/tests/deb-format-xz-compression-ubuntu/desc b/t/tests/deb-format-xz-compression-ubuntu/desc
index 17123e3..fa60813 100644
--- a/t/tests/deb-format-xz-compression-ubuntu/desc
+++ b/t/tests/deb-format-xz-compression-ubuntu/desc
@@ -2,5 +2,6 @@ Testname: deb-format-xz-compression-ubuntu
 Sequence: 6000
 Version: 1.0
 Profile: ubuntu/main
+Distribution: precise
 Description: Test of xz compression without dpkg pre-dep
 Test-For: data.tar.xz-member-without-dpkg-pre-depends
diff --git a/t/tests/distribution-ubuntu-native/desc b/t/tests/distribution-ubuntu-native/desc
index ac07567..078de44 100644
--- a/t/tests/distribution-ubuntu-native/desc
+++ b/t/tests/distribution-ubuntu-native/desc
@@ -3,4 +3,5 @@ Sequence: 2500
 Version: 1.0
 Description: Check *.changes distribution checking for Ubuntu
 Test-Against: bad-distribution-in-changes-file
+Profile: ubuntu/main
 References: Debian Bug#507740
diff --git a/t/tests/scripts-maintainer-general/desc b/t/tests/scripts-maintainer-general/desc
index 5c75566..20045f1 100644
--- a/t/tests/scripts-maintainer-general/desc
+++ b/t/tests/scripts-maintainer-general/desc
@@ -3,6 +3,7 @@ Sequence: 6000
 Type: native
 Version: 1.0
 Profile: ubuntu/main
+Distribution: precise
 Description: Check general problems in maintainer scripts
 Test-For:
  command-with-path-in-maintainer-script
diff --git a/testset/tags.scripts b/testset/tags.scripts
index 39be406..1a4b946 100644
--- a/testset/tags.scripts
+++ b/testset/tags.scripts
@@ -1,4 +1,3 @@
-E: scripts changes: bad-ubuntu-distribution-in-changes-file unstable
 E: scripts source: build-depends-on-obsolete-package build-depends-indep: dpatch
 E: scripts source: dpatch-index-references-non-existent-patch 01_not_here_right_now.dpatch
 E: scripts source: dpatch-index-references-non-existent-patch 01_some_other_patch_thats_not_in_the_package.dpatch
diff --git a/vendors/debian/ftp-master-auto-reject/data/changes-file/debian-dists b/vendors/debian/ftp-master-auto-reject/data/changes-file/debian-dists
deleted file mode 100644
index 589df1c..0000000
--- a/vendors/debian/ftp-master-auto-reject/data/changes-file/debian-dists
+++ /dev/null
@@ -1,16 +0,0 @@
-# A list of Debian distributions, both code names and their
-# aliases
-
-# Codenames
-lenny
-squeeze
-wheezy
-sid
-
-# Aliases
-oldstable
-stable
-testing
-unstable
-experimental
-
diff --git a/vendors/debian/ftp-master-auto-reject/data/changes-file/known-dists b/vendors/debian/ftp-master-auto-reject/data/changes-file/known-dists
new file mode 100644
index 0000000..65e85fd
--- /dev/null
+++ b/vendors/debian/ftp-master-auto-reject/data/changes-file/known-dists
@@ -0,0 +1,21 @@
+# A list of Debian distributions, both code names and their aliases
+# - Note that common "extensions"[1] are stripped before checking for the
+#   distribution name (except for "sid", "unstable" and "experimental").
+#
+# [1] -backports, -security, -proposed-updates etc.  See checks/changes-file
+# for the complete list.
+
+
+# Codenames
+lenny
+squeeze
+wheezy
+sid
+
+# Aliases
+oldstable
+stable
+testing
+unstable
+experimental
+
diff --git a/vendors/debian/ftp-master-auto-reject/data/changes-file/ubuntu-dists b/vendors/debian/ftp-master-auto-reject/data/changes-file/ubuntu-dists
deleted file mode 100644
index 0948ec9..0000000
--- a/vendors/debian/ftp-master-auto-reject/data/changes-file/ubuntu-dists
+++ /dev/null
@@ -1,11 +0,0 @@
-# A list of Ubuntu distributions, used to suppress some checks for Ubuntu
-# packages and to validate Ubuntu distributions.
-
-dapper
-hardy
-karmic
-lucid
-maverick
-natty
-oneiric
-precise
diff --git a/vendors/ubuntu/main/data/changes-file/known-dists b/vendors/ubuntu/main/data/changes-file/known-dists
new file mode 100644
index 0000000..dd6c89c
--- /dev/null
+++ b/vendors/ubuntu/main/data/changes-file/known-dists
@@ -0,0 +1,10 @@
+# List of ubuntu distributions
+
+dapper
+hardy
+karmic
+lucid
+maverick
+natty
+oneiric
+precise

-- 
Debian package checker


Reply to: