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

[SCM] Debian package checker branch, master, updated. 2.4.3-164-gc6b6d4a



The following commit has been merged in the master branch:
commit c19067fe6c79656154ed1d19ab01a6f1d57a28e1
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Jan 26 09:49:07 2011 +0100

    Moved "known_source_fields" into a data file

diff --git a/checks/common_data.pm b/checks/common_data.pm
index cb5b1a6..7bd90a4 100644
--- a/checks/common_data.pm
+++ b/checks/common_data.pm
@@ -1,31 +1,23 @@
-#! /usr/bin/perl -w
-
 package common_data;
+
+use strict;
+use warnings;
+
 use base qw(Exporter);
 
 our @EXPORT = qw
 (
-   %known_source_fields $known_shells_regex
+   $known_shells_regex
 );
 
 # To let "perl -cw" test know we use these variables;
 use vars qw
 (
-  %known_source_fields $known_shells_regex
+  $known_shells_regex
 );
 
 # simple defines for commonly needed data
 
-# The Ubuntu original-maintainer field is handled separately.
-%known_source_fields = map { $_ => 1 }
-    ('source', 'version', 'maintainer', 'binary', 'architecture',
-     'standards-version', 'files', 'build-depends', 'build-depends-indep',
-     'build-conflicts', 'build-conflicts-indep', 'format', 'origin',
-     'uploaders', 'python-version', 'autobuild', 'homepage', 'vcs-arch',
-     'vcs-bzr', 'vcs-cvs', 'vcs-darcs', 'vcs-git', 'vcs-hg', 'vcs-mtn',
-     'vcs-svn', 'vcs-browser', 'dm-upload-allowed', 'bugs', 'checksums-sha1',
-     'checksums-sha256', 'checksums-md5');
-
 $known_shells_regex = qr'(?:(?:b|d)?a|t?c|(?:pd|m)?k|z)?sh';
 
 1;
diff --git a/checks/control-file b/checks/control-file
index ff3762c..8c419bc 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -22,8 +22,8 @@ package Lintian::control_file;
 use strict;
 
 use lib "$ENV{'LINTIAN_ROOT'}/checks/";
-use common_data;
 
+use Lintian::Data ();
 use Lintian::Relation ();
 use Lintian::Tags qw(tag);
 use Util;
@@ -31,6 +31,7 @@ use Util;
 # The list of libc packages, used for checking for a hard-coded dependency
 # rather than using ${shlibs:Depends}.
 our @LIBCS = qw(libc6 libc6.1 libc0.1 libc0.3);
+my $src_fields = Lintian::Data->new('common/source-fields');
 
 sub run {
 
@@ -69,7 +70,7 @@ while (<CONTROL>) {
 			my $base = $field;
 			$base =~ s/^xs-//;
 			tag "xs-vcs-header-in-debian-control", "$field"
-			    if $known_source_fields{$base};
+			    if $src_fields->known($base);
 		}
 		if ($field eq 'xc-package-type') {
 			tag 'xc-package-type-in-debian-control', "line $.";
diff --git a/checks/fields b/checks/fields
index b163c16..cd365c5 100644
--- a/checks/fields
+++ b/checks/fields
@@ -26,7 +26,6 @@ package Lintian::fields;
 use strict;
 
 use lib "$ENV{'LINTIAN_ROOT'}/checks/";
-use common_data;
 
 use Util;
 
@@ -178,6 +177,7 @@ our $PYTHON_DEV = join(' | ', qw(python-dev python-all-dev python3-all-dev),
 our $PERL_CORE_PROVIDES = Lintian::Data->new('fields/perl-provides', '\s+');
 our $OBSOLETE_PACKAGES  = Lintian::Data->new('fields/obsolete-packages');
 our $VIRTUAL_PACKAGES   = Lintian::Data->new('fields/virtual-packages');
+our $SOURCE_FIELDS      = Lintian::Data->new('common/source-fields');
 
 sub run {
 
@@ -958,7 +958,7 @@ for my $field (readdir FIELDS) {
 	    if $known_obsolete_fields{$field};
 
 	tag "unknown-field-in-dsc", "$field"
-	    if ($type eq "source" && ! $known_source_fields{$field} && ! $known_obsolete_fields{$field});
+	    if ($type eq "source" && ! $SOURCE_FIELDS->known($field) && ! $known_obsolete_fields{$field});
 
 	tag "unknown-field-in-control", "$field"
 	    if ($type eq "binary" && ! $known_binary_fields{$field} && ! $known_obsolete_fields{$field});
diff --git a/data/common/source-fields b/data/common/source-fields
new file mode 100644
index 0000000..f6ae687
--- /dev/null
+++ b/data/common/source-fields
@@ -0,0 +1,34 @@
+# Manually maintained list of known source fields
+#  - please keep it sorted
+
+architecture
+autobuild
+binary
+bugs
+build-conflicts
+build-conflicts-indep
+build-depends
+build-depends-indep
+checksums-md5
+checksums-sha1
+checksums-sha256
+dm-upload-allowed
+files
+format
+homepage
+maintainer
+origin
+python-version
+source
+standards-version
+uploaders
+vcs-arch
+vcs-browser
+vcs-bzr
+vcs-cvs
+vcs-darcs
+vcs-git
+vcs-hg
+vcs-mtn
+vcs-svn
+version

-- 
Debian package checker


Reply to: