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

[SCM] Debian package checker branch, master, updated. 2.2.11-4-g4b1d916



The following commit has been merged in the master branch:
commit 4b1d9164c13b1f5d84290f6f96b2e3c0a39615ae
Author: Russ Allbery <rra@debian.org>
Date:   Wed Jun 17 16:18:23 2009 -0700

    Updates for source-field-malformed
    
    * checks/fields{,.desc}:
      + [RA] Update source-field-malformed to serious and don't allow
        capital letters in source package names.  Check source package names
        for validity even when checking only source packages to be sure the
        package name is syntactically valid.

diff --git a/checks/fields b/checks/fields
index 0636c2c..3ff9203 100644
--- a/checks/fields
+++ b/checks/fields
@@ -422,10 +422,13 @@ if (not defined $info->field('source')) {
 		if ($source ne $pkg) {
 			tag "source-field-does-not-match-pkg-name", "$source != $pkg";
 		}
+		if ($source !~ /^[a-z0-9][-+\.a-z0-9]+\z/) {
+			tag 'source-field-malformed', $source;
+		}
 	} else {
-		if ($source !~ /[A-Z0-9][-+\.A-Z0-9]+                      #Package name
+		if ($source !~ /^[a-z0-9][-+\.a-z0-9]+ # Package name
 		                \s*
-		                (?:\((?:\d+:)?(?:[-\.+:A-Z0-9~]+?)(?:-[\.+A-Z0-9~]+)?\))?\s*$/ix) { #Version
+		                (?:\((?:\d+:)?(?:[-\.+:a-zA-Z0-9~]+?)(?:-[\.+a-zA-Z0-9~]+)?\))?\s*$/x) { #Version
 			tag "source-field-malformed", "$source";
 		}
 	}
diff --git a/checks/fields.desc b/checks/fields.desc
index 4e7d849..2b02602 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -244,12 +244,16 @@ Info: The source package's filename is not the same as the name given
 Ref: policy 5.6.1
 
 Tag: source-field-malformed
-Severity: important
+Severity: serious
 Certainty: certain
-Info: In a binary package, the Source field should identify the source
- package from which the package was compiled.  It should be the
- source package name, optionally followed by a version number
- between parentheses.
+Info: In <tt>debian/control</tt> or a <tt>.dsc</tt> file, the Source field
+ must contain only the name of the source package.  In a binary package,
+ the Source field may also optionally contain the version number of the
+ corresponding source package in parentheses.
+ .
+ Source package names must consist only of lowercase letters, digits,
+ plus and minus signs, and periods.  They must be at least two characters
+ long and must start with an alphanumeric character.
 Ref: policy 5.6.1
 
 Tag: essential-in-source-package
diff --git a/debian/changelog b/debian/changelog
index 4b551b9..a0d7546 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,11 @@ lintian (2.2.12) UNRELEASED; urgency=low
       rename the missing-comma-between-items tag to the more descriptive
       missing-separator-between-items.  Based on a patch by Rafael
       Laboissiere.  (Closes: #533202)
+  * checks/fields{,.desc}:
+    + [RA] Update source-field-malformed to serious and don't allow
+      capital letters in source package names.  Check source package names
+      for validity even when checking only source packages to be sure the
+      package name is syntactically valid.
   * checks/files{,.desc}:
     + [RA] Diagnose files installed into discouraged or unknown
       subdirectories of /usr/share/fonts/X11 per Policy 11.8.5.
diff --git a/t/COVERAGE b/t/COVERAGE
index 3c10fdd..c16ff3a 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,4 +1,4 @@
-Last generated 2009-05-28
+Last generated 2009-06-17
 
 The following tags are not tested by the test suite:
 
@@ -50,6 +50,7 @@ debhelper dh_dhelp-is-deprecated
 
 debian-readme spelling-error-in-readme-debian
 
+fields alternates-not-allowed
 fields arch-any-in-binary-pkg
 fields aspell-package-not-arch-all
 fields bad-menu-item
@@ -78,7 +79,6 @@ fields package-depends-on-multiple-tclx-versions
 fields package-not-lowercase
 fields package-superseded-by-perl
 fields source-field-does-not-match-pkg-name
-fields source-field-malformed
 fields too-many-architectures
 fields unknown-architecture
 fields unknown-field-in-control
@@ -313,7 +313,6 @@ debian-readme readme-debian-mentions-usr-doc
 
 etcfiles file-in-etc-not-marked-as-conffile
 
-fields alternates-not-allowed
 fields bad-version-in-relation
 fields binary-nmu-debian-revision-in-source
 fields binary-nmu-uses-old-version-style
diff --git a/t/debs/description-synopsis-spaces/Makefile b/t/debs/fields-malformed-source/Makefile
similarity index 92%
copy from t/debs/description-synopsis-spaces/Makefile
copy to t/debs/fields-malformed-source/Makefile
index d0152b2..dd9605a 100644
--- a/t/debs/description-synopsis-spaces/Makefile
+++ b/t/debs/fields-malformed-source/Makefile
@@ -1,4 +1,4 @@
-name = description-synopsis-spaces
+name = fields-malformed-source
 
 all:
 	echo '2.0' > debian-binary
diff --git a/t/debs/deb-format-record-size/changelog b/t/debs/fields-malformed-source/changelog
similarity index 69%
copy from t/debs/deb-format-record-size/changelog
copy to t/debs/fields-malformed-source/changelog
index b28456d..8eceb4d 100644
--- a/t/debs/deb-format-record-size/changelog
+++ b/t/debs/fields-malformed-source/changelog
@@ -1,4 +1,4 @@
-deb-format-record-size (1.0) unstable; urgency=low
+fields-malformed-source (1.0) unstable; urgency=low
 
   * A Lintian test case.
 
diff --git a/t/debs/deb-format-ancient-file/control b/t/debs/fields-malformed-source/control
similarity index 77%
copy from t/debs/deb-format-ancient-file/control
copy to t/debs/fields-malformed-source/control
index 560622a..ed9b8f5 100644
--- a/t/debs/deb-format-ancient-file/control
+++ b/t/debs/fields-malformed-source/control
@@ -1,10 +1,11 @@
-Package: deb-format-ancient-file
+Package: fields-malformed-source
+Source: Malformed
 Version: 1.0
 Architecture: all
 Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
 Section: devel
 Priority: extra
-Description: Test package containing an ancient file
+Description: test for bad source package name
  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/debs/deb-format-ancient-file/copyright b/t/debs/fields-malformed-source/copyright
similarity index 100%
copy from t/debs/deb-format-ancient-file/copyright
copy to t/debs/fields-malformed-source/copyright
diff --git a/t/debs/fields-malformed-source/tags b/t/debs/fields-malformed-source/tags
new file mode 100644
index 0000000..4dc19a6
--- /dev/null
+++ b/t/debs/fields-malformed-source/tags
@@ -0,0 +1 @@
+E: fields-malformed-source: source-field-malformed Malformed

-- 
Debian package checker


Reply to: