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

[SCM] Debian package checker branch, master, updated. 2.2.18-33-g3cfd89c



The following commit has been merged in the master branch:
commit d274f37c1b7d866d6abdf9d8835a6411da4c7e8e
Author: Russ Allbery <rra@debian.org>
Date:   Wed Dec 23 21:39:59 2009 -0800

    Add -F flag to check only ftp-master reject tags
    
    * data/output/ftp-master-{non,}fatal:
      + [RA] New data files listing tags that may result in an automated
        upload reject.
    * frontend/lintian:
      + [RA] Add option -F or --ftp-master-rejects which only checks tags
        that could result in an automatic upload reject.
    * man/lintian.1:
      + [RA] Document -F (--ftp-master-rejects).
    * private/refresh-ftp-master-tags:
      + [RA] Script to refresh data about automatic package rejects.

diff --git a/data/output/ftp-master-fatal b/data/output/ftp-master-fatal
new file mode 100644
index 0000000..c083b05
--- /dev/null
+++ b/data/output/ftp-master-fatal
@@ -0,0 +1,68 @@
+# This file lists all tags that cause an automatic reject on upload and cannot
+# be overridden.  It is based on the data file retrieved from
+# http://ftp-master.debian.org/static/lintian.tags
+#
+# Last updated: 2009-12-24
+
+FSSTND-dir-in-usr
+FSSTND-dir-in-var
+arch-any-in-binary-pkg
+bad-package-name
+bad-package-name
+bad-relation
+bad-version-number
+binary-file-compressed-with-upx
+binary-in-etc
+build-info-in-binary-control-file-section
+control-file-has-bad-owner
+control-file-has-bad-permissions
+control-interpreter-in-usr-local
+copyright-file-compressed
+copyright-file-is-symlink
+copyright-refers-to-incorrect-directory
+copyright-refers-to-old-directory
+debian-control-file-uses-obsolete-national-encoding
+debian-control-with-duplicate-fields
+debian-rules-missing-required-target
+debian-rules-not-a-makefile
+description-is-dh_make-template
+description-synopsis-is-empty
+dir-or-file-in-mnt
+dir-or-file-in-opt
+dir-or-file-in-srv
+dir-or-file-in-tmp
+extended-description-is-empty
+file-in-etc-not-marked-as-conffile
+file-in-usr-marked-as-conffile
+forbidden-postrm-interpreter
+library-in-debug-or-profile-should-not-be-stripped
+magic-arch-in-arch-list
+maintainer-address-is-on-localhost
+maintainer-address-malformed
+maintainer-address-missing
+maintainer-name-missing
+maintainer-script-removes-device-files
+malformed-deb-archive
+missing-dependency-on-perlapi
+no-architecture-field
+no-architecture-field
+no-copyright-file
+no-maintainer-field
+no-package-name
+no-source-field
+no-version-field
+not-allowed-control-file
+old-style-copyright-file
+package-contains-ancient-file
+package-has-no-description
+package-installs-python-pyc
+package-not-lowercase
+package-uses-local-diversion
+section-is-dh_make-template
+source-field-does-not-match-pkg-name
+symlink-has-too-many-up-segments
+too-many-architectures
+uploader-address-is-on-localhost
+uploader-address-malformed
+uploader-name-missing
+usr-share-doc-symlink-to-foreign-package
diff --git a/data/output/ftp-master-nonfatal b/data/output/ftp-master-nonfatal
new file mode 100644
index 0000000..0cd4778
--- /dev/null
+++ b/data/output/ftp-master-nonfatal
@@ -0,0 +1,26 @@
+# This file lists all tags that cause an automatic reject on upload but can
+# be overridden (nonfatal tags).  It is based on the data file retrieved from
+# http://ftp-master.debian.org/static/lintian.tags
+#
+# Last updated: 2009-12-24
+
+arch-dependent-file-in-usr-share
+arch-dependent-file-in-usr-share
+arch-independent-package-contains-binary-or-object
+binary-or-shlib-defines-rpath
+binary-with-bad-dynamic-table
+control-interpreter-without-depends
+copyright-contains-dh_make-todo-boilerplate
+dir-or-file-in-var-www
+embedded-zlib
+missing-build-dependency
+missing-dependency-on-libc
+mknod-in-maintainer-script
+no-shlibs-control-file
+non-etc-file-marked-as-conffile
+package-contains-info-dir-file
+preinst-interpreter-without-predepends
+statically-linked-binary
+usr-share-doc-symlink-without-dependency
+usr-share-doc-symlink-without-dependency
+wrong-file-owner-uid-or-gid
diff --git a/debian/changelog b/debian/changelog
index 19a071a..3b89d10 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,10 @@ lintian (2.3.0) UNRELEASED; urgency=low
       all of the descriptive text is included.  Thanks, Jonathan Wiltshire.
       (Closes: #557786)
 
+  * data/output/ftp-master-{non,}fatal:
+    + [RA] New data files listing tags that may result in an automated
+      upload reject.
+
   * frontend/lintian:
     + [RA] Add options --suppress-tags and --suppress-tags-from-file to
       completely suppress the given tags.
@@ -22,6 +26,8 @@ lintian (2.3.0) UNRELEASED; urgency=low
       setting variables in the Tags namespace.  Move display level code
       from here to Lintian::Tags.  Adjust calls for the new Lintian::Tags
       module.
+    + [RA] Add option -F or --ftp-master-rejects which only checks tags
+      that could result in an automatic upload reject.
 
   * lib/Lintian/Check.pm:
     + [RA] Use Lintian::Tags instead of Tags.
@@ -66,6 +72,10 @@ lintian (2.3.0) UNRELEASED; urgency=low
   * man/lintian.1:
     + [RA] Document --suppress-tags and --suppress-tags-from-file.
     + [RA] Document format of --tags-from-file.
+    + [RA] Document -F (--ftp-master-rejects).
+
+  * private/refresh-ftp-master-tags:
+    + [RA] Script to refresh data about automatic package rejects.
 
   * t/runtests:
     + [RA] Unwrap the Options field so that it can be continued.
diff --git a/frontend/lintian b/frontend/lintian
index 58b8db6..dce3e23 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -47,6 +47,7 @@ my $check_everything = 0;	#flag for -a|--all switch
 my $lintian_info = 0;		#flag for -i|--info switch
 our $display_experimentaltags = 0; #flag for -E|--display-experimental switch
 our $display_pedantictags = 0;	#flag for --pedantic switch
+our $ftpmaster_tags = 0;	#flag for -F|--ftp-master-rejects switch
 my $unpack_level = undef;	#flag for -l|--unpack-level switch
 our $no_override = 0;		#flag for -o|--no-override switch
 our $show_overrides = 0;	#flag for --show-overrides switch
@@ -137,6 +138,7 @@ Actions:
     -X X, --dont-check-part X don\'t check certain aspects
     -T X, --tags X            only run checks needed for requested tags
     --tags-from-file X        like --tags, but read list from file
+    -F, --ftp-master-rejects  only check for automatic reject tags
     -u, --unpack              only unpack packages in the lab
     -r, --remove              remove package from the lab
 General options:
@@ -354,6 +356,7 @@ my %opthash = (			# ------------------ actions
 	       "check-part|C=s" => \&record_check_part,
 	       "tags|T=s" => \&record_check_tags,
 	       "tags-from-file=s" => \&record_check_tags_from_file,
+	       "ftp-master-rejects|F" => \$ftpmaster_tags,
 	       "dont-check-part|X=s" => \&record_dont_check_part,
 	       "unpack|u" => \&record_action,
 	       "remove|r" => \&record_action,
@@ -628,6 +631,14 @@ $Lintian::Output::GLOBAL->quiet($quiet);
 $Lintian::Output::GLOBAL->color($color);
 $Lintian::Output::GLOBAL->showdescription($lintian_info);
 
+# Now that we can load the data, process the -F or --ftp-master-rejects
+# option.
+if ($ftpmaster_tags) {
+    my $fatal = Lintian::Data->new('output/ftp-master-fatal');
+    my $nonfatal = Lintian::Data->new('output/ftp-master-nonfatal');
+    $check_tags = join(',', $fatal->all, $nonfatal->all);
+}
+
 # Print Debug banner, now that we're finished determining
 # the values and have Lintian::Output available
 debug_msg(1,
diff --git a/man/lintian.1 b/man/lintian.1
index bded6bf..f3cd58d 100644
--- a/man/lintian.1
+++ b/man/lintian.1
@@ -102,6 +102,14 @@ with # are ignored.  All other lines are taken to be tag names or
 comma-separated lists of tag names to suppress.
 
 .TP
+.BR \-F , \-\-ftp\-master\-rejects
+Run only the checks that issue tags that result in automatic rejects from
+the Debian upload queue.  The list of such tags is refreshed with each
+Lintian release, so may be slightly out of date if it has changed
+recently.  This option does not, as yet, ignore overrides for fatal tags
+for which overrides aren't allowed.
+
+.TP
 .BR \-X " chk1,chk2,..., " \-\-dont\-check\-part " chk1,chk2,..."
 Run all but the the specified checks.  You can either specify
 the name of the check script or the abbreviation.
diff --git a/private/refresh-ftp-master-tags b/private/refresh-ftp-master-tags
new file mode 100755
index 0000000..76d3f5f
--- /dev/null
+++ b/private/refresh-ftp-master-tags
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+#
+# refresh-ftp-master-tags -- Refresh Lintian data about ftp-master reject tags
+#
+# Copyright 2009 Russ Allbery
+#
+# This program is free software.  It is distributed under the terms of the GNU
+# General Public License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, you can find it on the World Wide Web at
+# http://www.gnu.org/copyleft/gpl.html, or write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+use strict;
+use warnings;
+
+use LWP::Simple qw(get);
+use POSIX qw(strftime);
+
+BEGIN {
+    my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'};
+    if (not $LINTIAN_ROOT) {
+        use Cwd ();
+        $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT = Cwd::cwd();
+    } else {
+        chdir $LINTIAN_ROOT or die "Cannot chdir to $LINTIAN_ROOT: $!\n";
+    }
+}
+
+our $YAML_URL = 'http://ftp-master.debian.org/static/lintian.tags';
+
+# Retrieve the YAML file that determines which ftp-master tags warrant a
+# reject and then parse it.  We should probably use a real YAML parser, but
+# that requires every Lintian maintainer to install it.
+my $yaml = get($YAML_URL);
+die "Cannot retrieve $YAML_URL\n" unless $yaml;
+my @yaml = split(/\n+/, $yaml);
+shift @yaml while (@yaml and $yaml[0] =~ /^\s*$/);
+die "Unknown YAML file format (first line: $yaml[0])\n"
+    unless $yaml[0] =~ /^\s*lintian:\s*$/;
+shift @yaml;
+my (@nonfatal, @fatal, $current);
+for my $line (@yaml) {
+    if ($line =~ /^\s*nonfatal:\s*$/) {
+        $current = \@nonfatal;
+    } elsif ($line =~ /^\s*fatal:\s*$/) {
+        $current = \@fatal;
+    } elsif ($line =~ /^\s*-\s+(\S+)\s*$/) {
+        die "Tag listed outside of section\n" unless $current;
+        push (@$current, $1);
+    } else {
+        die "Unrecognized line: $line\n";
+    }
+}
+
+# Print out the fatal and nonfatal tags to our data files.
+my $date = strftime('%Y-%m-%d', gmtime);
+open(NONFATAL, '>', 'data/output/ftp-master-nonfatal')
+    or die "Cannot create data/output/ftp-master-nonfatal: $!\n";
+print NONFATAL <<"EOH";
+# This file lists all tags that cause an automatic reject on upload but can
+# be overridden (nonfatal tags).  It is based on the data file retrieved from
+# $YAML_URL
+#
+# Last updated: $date
+
+EOH
+print NONFATAL join("\n", sort(@nonfatal), '');
+close NONFATAL;
+open(FATAL, '>', 'data/output/ftp-master-fatal')
+    or die "Cannot create data/output/ftp-master-fatal: $!\n";
+print FATAL <<"EOH";
+# This file lists all tags that cause an automatic reject on upload and cannot
+# be overridden.  It is based on the data file retrieved from
+# $YAML_URL
+#
+# Last updated: $date
+
+EOH
+print FATAL join("\n", sort(@fatal), '');
+close FATAL;
diff --git a/t/tests/lintian-display-level/debian/debian/control.in b/t/tests/lintian-ftp-rejects/debian/debian/control.in
similarity index 100%
copy from t/tests/lintian-display-level/debian/debian/control.in
copy to t/tests/lintian-ftp-rejects/debian/debian/control.in
diff --git a/t/tests/lintian-display-level/debian/debian/dirs b/t/tests/lintian-ftp-rejects/debian/debian/dirs
similarity index 77%
copy from t/tests/lintian-display-level/debian/debian/dirs
copy to t/tests/lintian-ftp-rejects/debian/debian/dirs
index 055295f..db81444 100644
--- a/t/tests/lintian-display-level/debian/debian/dirs
+++ b/t/tests/lintian-ftp-rejects/debian/debian/dirs
@@ -1,2 +1,3 @@
 usr/local/share/lintian
 var/lock/lintian
+opt/lintian
diff --git a/t/tests/lintian-display-level/debian/debian/rules b/t/tests/lintian-ftp-rejects/debian/debian/rules
similarity index 100%
copy from t/tests/lintian-display-level/debian/debian/rules
copy to t/tests/lintian-ftp-rejects/debian/debian/rules
diff --git a/t/tests/lintian-ftp-rejects/desc b/t/tests/lintian-ftp-rejects/desc
new file mode 100644
index 0000000..f369105
--- /dev/null
+++ b/t/tests/lintian-ftp-rejects/desc
@@ -0,0 +1,6 @@
+Testname: lintian-ftp-rejects
+Sequence: 2500
+Version: 1.0
+Options: -F
+Description: Test Lintian --ftp-master-rejects handling
+Test-For: dir-or-file-in-opt
diff --git a/t/tests/lintian-ftp-rejects/tags b/t/tests/lintian-ftp-rejects/tags
new file mode 100644
index 0000000..1a4f6cb
--- /dev/null
+++ b/t/tests/lintian-ftp-rejects/tags
@@ -0,0 +1 @@
+E: lintian-ftp-rejects: dir-or-file-in-opt opt/lintian/

-- 
Debian package checker


Reply to: