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

[SCM] Debian package checker branch, master, updated. 2.1.4-5-gf8d6a2a



The following commit has been merged in the master branch:
commit f8d6a2a720374822852b5fd53d704a89f352dc99
Author: Russ Allbery <rra@debian.org>
Date:   Sat Jan 10 14:41:52 2009 -0800

    Check the Changed-By field of *.changes files
    
    * checks/lintian.desc:
      + [RA] New tag descriptions for Changed-By field tests.
    * frontend/lintian:
      + [RA] Run maintainer well-formedness checks on the Changed-By field
        of the *.changes file.  (Closes: #183642)

diff --git a/checks/lintian.desc b/checks/lintian.desc
index ef8351a..c1b6d56 100644
--- a/checks/lintian.desc
+++ b/checks/lintian.desc
@@ -68,6 +68,41 @@ Info: The sections <tt>non-free</tt> and <tt>contrib</tt> are no longer
  <tt>contrib/xxx</tt> instead.
 Ref: policy 2.4
 
+Tag: changed-by-name-missing
+Severity: serious
+Certainty: certain
+Info: The Changed-By field seems to contain just an email address. It must
+ contain the package maintainer's name and email address.
+Ref: policy 5.6.4
+
+Tag: changed-by-address-missing
+Severity: serious
+Certainty: certain
+Info: The Changed-By field should contain the package builder's name and
+ email address, with the name followed by the address inside angle
+ brackets (&lt; and &gt;).  The address seems to be missing.
+Ref: policy 5.6.4
+
+Tag: changed-by-address-malformed
+Severity: important
+Certainty: certain
+Info: The Changed-By field could not be parsed according to the rules in
+ the Policy Manual.
+Ref: policy 5.6.4
+
+Tag: changed-by-address-looks-weird
+Severity: normal
+Certainty: possible
+Info: The Changed-By field does not have whitespace between the name
+ and the email address.
+
+Tag: changed-by-address-is-on-localhost
+Severity: important
+Certainty: certain
+Info: The Changed-By address includes localhost(.localdomain), which is
+ an invalid e-mail address.
+Ref: policy 5.6.2
+
 Tag: unused-override
 Severity: wishlist
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index ee4d888..d49044a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,11 @@ lintian (2.1.5) UNRELEASED; urgency=low
 
   * Summary of tag changes:
     + Added
+      - changed-by-address-is-on-localhost
+      - changed-by-address-looks-weird
+      - changed-by-address-malformed
+      - changed-by-address-missing
+      - changed-by-name-missing
       - duplicate-long-description
       - duplicate-short-description
 
@@ -9,15 +14,22 @@ lintian (2.1.5) UNRELEASED; urgency=low
     + [RA] Tag (severity: wishlist) duplicate short or long descriptions
       in packages built from the same source.  (Closes: #30020)
   * checks/fields:
-    + [RA] Use check_maintainer from Lintian::Check.
+    + [RA] Use check_maintainer from Lintian::Check, which suppresses
+      duplicate tags for some ill-formed maintainer fields.
+  * checks/lintian.desc:
+    + [RA] New tag descriptions for Changed-By field tests.
   * checks/rules:
     + [RA] Consider a define command to be the end of a list of target
       commands, avoiding binary-arch-rules-but-pkg-is-arch-indep false
       positives when an empty rule is followed by a definition.
       (Closes: #510869)
 
+  * frontend/lintian:
+    + [RA] Run maintainer well-formedness checks on the Changed-By field
+      of the *.changes file.  (Closes: #183642)
+
   * lib/Lintian/Check.pm:
-    + [RA] New module collecting checks run from multiple places.
+    + [RA] New module for checks run from multiple places.
 
   * t/runtests:
     + [RA] Add support for running lintian on changes files in t/changes
diff --git a/frontend/lintian b/frontend/lintian
index ea4bc34..7252315 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -633,6 +633,8 @@ require Lintian::Output;
 import Lintian::Output qw(:messages);
 require Lintian::Command;
 import Lintian::Command qw(spawn);
+require Lintian::Check;
+import Lintian::Check qw(check_maintainer);
 
 no warnings 'once';
 if (defined $experimental_output_opts) {
@@ -829,6 +831,12 @@ while (my $arg = shift) {
 		}
 	    }
 
+	    # Changed-By is optional in Policy, but if set, must be
+	    # syntactically correct.  It's also used by dak.
+	    if ($data->{'changed-by'}) {
+		check_maintainer($data->{'changed-by'}, 'changed-by');
+	    }
+
 	    # process all listed `files:'
 	    my %files;
 
diff --git a/lib/Lintian/Check.pm b/lib/Lintian/Check.pm
index a8539ad..e721150 100644
--- a/lib/Lintian/Check.pm
+++ b/lib/Lintian/Check.pm
@@ -64,7 +64,7 @@ Checks the maintainer name and address MAINTAINER for Policy compliance
 and other issues.  FIELD is the context in which the maintainer name and
 address was seen and should be one of C<maintainer> (the Maintainer field
 in a control file), C<uploader> (the Uploaders field in a control file),
-or C<changes> (the Changed-By field in a changes file).
+or C<changed-by> (the Changed-By field in a changes file).
 
 The following tags may be issued by this function.  The string C<%s> in
 the tags below will be replaced with the value of FIELD.
@@ -99,7 +99,7 @@ address was not in angle brackets.
 =item %s-not-full-name
 
 The name portion of MAINTAINER is a single word.  This tag is not issued
-for a FIELD of C<changes>.
+for a FIELD of C<changed-by>.
 
 =item wrong-debian-qa-address-set-as-maintainer
 
@@ -133,8 +133,11 @@ sub check_maintainer {
     }
 
     # Some basic tests.
-    tag "$field-address-malformed", $maintainer
-        if $extra;
+    my $malformed;
+    if ($extra) {
+        tag "$field-address-malformed", $maintainer;
+        $malformed = 1;
+    }
     tag "$field-address-looks-weird", $maintainer
         if (not $del and $name and $mail);
 
@@ -146,14 +149,15 @@ sub check_maintainer {
         tag "$field-name-missing", $maintainer;
     } elsif ($name !~ /^\S+\s+\S+/ and $name ne 'Wookey') {
         tag "$field-not-full-name", $name
-            if $field ne 'changes';
+            if $field ne 'changed-by';
     }
 
-    # This should really be done with Email::Valid.
+    # This should really be done with Email::Valid.  Don't issue the malformed
+    # tag twice if we already saw problems.
     if (not $mail) {
         tag "$field-address-missing", $maintainer;
     } else {
-	if ($mail !~ /^[^()<>@,;:\\\"\[\]]+@(\S+\.)+\S+/) {
+	if (not $malformed and $mail !~ /^[^()<>@,;:\\\"\[\]]+@(\S+\.)+\S+/) {
             tag "$field-address-malformed", $maintainer;
 	}
 	if ($mail =~ /(?:localhost|\.localdomain|\.localnet)$/) {
diff --git a/t/COVERAGE b/t/COVERAGE
index c639a89..959c955 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,4 +1,4 @@
-Last generated 2009-01-03
+Last generated 2009-01-10
 
 The following tags are not tested by the test suite:
 
diff --git a/t/changes/changed-by-localhost.changes b/t/changes/changed-by-localhost.changes
new file mode 100644
index 0000000..51d9619
--- /dev/null
+++ b/t/changes/changed-by-localhost.changes
@@ -0,0 +1,12 @@
+Format: 1.8
+Date: Sat, 10 Jan 2009 10:50:38 -0800
+Source: changed-by-malformed
+Binary: changed-by-malformed
+Architecture: source all
+Version: 1.0
+Distribution: unstable
+Urgency: low
+Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
+Changed-By: Someone <someone@localhost.localdomain>
+Description:
+ changed-by-malformed - Test Changed-By field with localhost address
diff --git a/t/changes/changed-by-localhost.tags b/t/changes/changed-by-localhost.tags
new file mode 100644
index 0000000..2aec261
--- /dev/null
+++ b/t/changes/changed-by-localhost.tags
@@ -0,0 +1 @@
+E: changed-by-localhost.changes: changed-by-address-is-on-localhost Someone <someone@localhost.localdomain>
diff --git a/t/changes/changed-by-malformed.changes b/t/changes/changed-by-malformed.changes
new file mode 100644
index 0000000..b6e8ec7
--- /dev/null
+++ b/t/changes/changed-by-malformed.changes
@@ -0,0 +1,12 @@
+Format: 1.8
+Date: Sat, 10 Jan 2009 10:50:38 -0800
+Source: changed-by-malformed
+Binary: changed-by-malformed
+Architecture: source all
+Version: 1.0
+Distribution: unstable
+Urgency: low
+Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
+Changed-By: Foo<bar> Baz
+Description:
+ changed-by-malformed - Test malformed Changed-By field
diff --git a/t/changes/changed-by-malformed.tags b/t/changes/changed-by-malformed.tags
new file mode 100644
index 0000000..220f7b0
--- /dev/null
+++ b/t/changes/changed-by-malformed.tags
@@ -0,0 +1,2 @@
+E: changed-by-malformed.changes: changed-by-address-malformed Foo<bar> Baz
+W: changed-by-malformed.changes: changed-by-address-looks-weird Foo<bar> Baz
diff --git a/t/changes/changed-by-no-name.changes b/t/changes/changed-by-no-name.changes
new file mode 100644
index 0000000..1053dd3
--- /dev/null
+++ b/t/changes/changed-by-no-name.changes
@@ -0,0 +1,12 @@
+Format: 1.8
+Date: Sat, 10 Jan 2009 10:50:38 -0800
+Source: changed-by-malformed
+Binary: changed-by-malformed
+Architecture: source all
+Version: 1.0
+Distribution: unstable
+Urgency: low
+Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
+Changed-By: someone@example.com
+Description:
+ changed-by-malformed - Test Changed-By field with localhost address
diff --git a/t/changes/changed-by-no-name.tags b/t/changes/changed-by-no-name.tags
new file mode 100644
index 0000000..ee84e74
--- /dev/null
+++ b/t/changes/changed-by-no-name.tags
@@ -0,0 +1 @@
+E: changed-by-no-name.changes: changed-by-name-missing someone@example.com
diff --git a/t/tests/6500_generic-empty.desc b/t/tests/6500_generic-empty.desc
index d29ce59..4d111ce 100644
--- a/t/tests/6500_generic-empty.desc
+++ b/t/tests/6500_generic-empty.desc
@@ -3,6 +3,8 @@ Version: 1.0
 Description: Pathological empty package
 Test-For:
  bad-urgency-in-changes-file
+ changed-by-address-malformed
+ changed-by-address-missing
  changelog-should-mention-nmu
  debian-rules-missing-required-target
  maintainer-address-missing
diff --git a/t/tests/generic-empty/tags b/t/tests/generic-empty/tags
index d5f7c5a..92ffca1 100644
--- a/t/tests/generic-empty/tags
+++ b/t/tests/generic-empty/tags
@@ -6,6 +6,8 @@ E: generic-empty: maintainer-address-missing a
 E: generic-empty: no-copyright-file
 E: generic-empty: package-has-no-description
 E: generic-empty_1.0_arch.changes: bad-urgency-in-changes-file unknown
+E: generic-empty_1.0_arch.changes: changed-by-address-malformed a <>
+E: generic-empty_1.0_arch.changes: changed-by-address-missing a <>
 W: generic-empty source: changelog-should-mention-nmu
 W: generic-empty source: maintainer-not-full-name a
 W: generic-empty source: no-section-field-for-source
diff --git a/testset/tags.foo++ b/testset/tags.foo++
index 2894afb..599d179 100644
--- a/testset/tags.foo++
+++ b/testset/tags.foo++
@@ -13,6 +13,7 @@ E: foo++: debian-changelog-file-contains-debmake-default-email-address he@unknow
 E: foo++: debian-changelog-file-uses-obsolete-national-encoding at line 11
 E: foo++: no-copyright-file
 E: foo++: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
+E: foo++_arch.changes: changed-by-address-malformed Marc 'HE' Brockschmidt <he@unknown>
 I: foo++ source: duplicate-short-description foo++ foo++-helper
 I: foo++: no-md5sums-control-file
 W: foo++ source: ancient-standards-version 3.1.1 (current is 3.8.0)
diff --git a/t/tests/generic-empty/post_test b/testset/tags.foo++.sed
similarity index 100%
copy from t/tests/generic-empty/post_test
copy to testset/tags.foo++.sed

-- 
Debian package checker


Reply to: