lintian: r90 - in trunk: checks debian testset testset/foo++/debian
Author: jeroen
Date: 2004-03-05 04:41:20 +0100 (Fri, 05 Mar 2004)
New Revision: 90
Modified:
trunk/checks/fields
trunk/checks/fields.desc
trunk/debian/changelog
trunk/testset/foo++/debian/changelog
trunk/testset/foo++/debian/control
trunk/testset/info_tags.foo++
trunk/testset/tags.foo++
Log:
Test for correct Uploaders: too
Modified: trunk/checks/fields
===================================================================
--- trunk/checks/fields 2004-03-05 01:05:04 UTC (rev 89)
+++ trunk/checks/fields 2004-03-05 03:41:20 UTC (rev 90)
@@ -126,49 +126,20 @@
single_line('maintainer', $_);
- # Zap leading and trailing whitespace
- s/^\s+//;
- s/\s+$//;
+ check_maint('maintainer', $_);
+}
- # Parse maintainer-address. Policy Manual 5.6.2 says:
- # The package maintainer's name and email address. The name should
- # come first, then the email address inside angle brackets <> (in
- # RFC822 format).
- # Note that it is _not_ necessary for the name to be in any particular
- # format. However, lintian will emit warnings if it doesn't look
- # like a full name.
- if (not m/(.*?)<(.*?)>(.*)/) {
- if (m/@/) {
- # Name is missing and address does not have <> around it
- tag_error("maintainer-name-missing", $_);
- } else {
- # address is missing
- tag_error("maintainer-address-missing", $_);
- }
- } else {
- my ($name, $addr, $rest) = ($1, $2, $3);
- # Check that there is something before the address and nothing
- # after it, and that the address looks vaguely like user@domain.foo.
- # Full RFC822 parsing is probably overkill.
- if (not $name) {
- tag_error("maintainer-name-missing", $_);
- } elsif ($rest or $addr !~ m/.+@.+\..+/) {
- tag_error("maintainer-address-malformed", $_);
- } elsif ($name !~ m/\s\S/) {
- # Also complain if the maintainer name has no embedded spaces
- tag_warn("maintainer-not-full-name", $name);
- } elsif ($name !~ m/\s$/) {
- # And complain if there is no whitespace between the
- # name and the address.
- tag_warn("maintainer-address-looks-weird", $_);
- }
- if ($addr =~ /localhost(?:\.localdomain)?$/) {
- tag_error("maintainer-address-is-on-localhost", $_);
- }
- if ($addr eq 'debian-qa@lists.debian.org') {
- tag_error("wrong-debian-qa-address-set-as-maintainer", $_);
- }
+if (open(IN, "fields/uploaders")) {
+ chop($_ = <IN>);
+ close(IN);
+
+ single_line('uploaders', $_);
+
+ # somehow doesn't catch the ', ,' case, where nothing is between comma's
+ # I don't get it... --Jeroen
+ for (split /,/) {
+ check_maint('uploader', $_);
}
}
@@ -604,3 +575,58 @@
return 1;
}
+
+sub check_maint {
+ my $type = shift;
+ $_ = shift;
+
+ # Zap leading and trailing whitespace
+ s/^\s+//;
+ s/\s+$//;
+
+ # Parse maintainer-address. Policy Manual 5.6.2 says:
+ # The package maintainer's name and email address. The name should
+ # come first, then the email address inside angle brackets <> (in
+ # RFC822 format).
+ # Note that it is _not_ necessary for the name to be in any particular
+ # format. However, lintian will emit warnings if it doesn't look
+ # like a full name.
+ if (not m/(.*?)<(.*?)>(.*)/) {
+ if (m/@/) {
+ # Name is missing and address does not have <> around it
+ tag_error("$type-name-missing", $_);
+ } else {
+ # address is missing
+ tag_error("$type-address-missing", $_);
+ }
+ } else {
+ my ($name, $addr, $rest) = ($1, $2, $3);
+ # Check that there is something before the address and nothing
+ # after it, and that the address looks vaguely like user@domain.foo.
+ # Full RFC822 parsing is probably overkill.
+ if (not $name) {
+ tag_error("$type-name-missing", $_);
+ } elsif ($rest or $addr !~ m/.+@.+\..+/) {
+ tag_error("$type-address-malformed", $_);
+ } elsif ($name !~ m/\s\S/) {
+ # Also complain if the maintainer name has no embedded spaces
+ tag_warn("$type-not-full-name", $name);
+ } elsif ($name !~ m/\s$/) {
+ # And complain if there is no whitespace between the
+ # name and the address.
+ tag_warn("$type-address-looks-weird", $_);
+ }
+
+ if ($addr =~ /localhost(?:\.localdomain)?$/) {
+ tag_error("$type-address-is-on-localhost", $_);
+ }
+ if ($type eq 'maintainer'
+ and $addr eq 'debian-qa@lists.debian.org') {
+ tag_error("wrong-debian-qa-address-set-as-maintainer", $_);
+ }
+ }
+
+ return 1;
+}
+
+# vim: ts=8 sw=4
Modified: trunk/checks/fields.desc
===================================================================
--- trunk/checks/fields.desc 2004-03-05 01:05:04 UTC (rev 89)
+++ trunk/checks/fields.desc 2004-03-05 03:41:20 UTC (rev 90)
@@ -111,6 +111,41 @@
an invalid e-mail address.
Ref: policy 5.6.2
+Tag: uploader-name-missing
+Type: error
+Info: The uploader field seems to contain just an email address. It must
+ contain the package uploader's name and email address.
+Ref: policy 5.6.2
+
+Tag: uploader-address-missing
+Type: error
+Info: The uploader field should contain the package uploader's name and
+ email address, with the name followed by the address inside angle
+ brackets (< and &rt;). The address seems to be missing.
+Ref: policy 5.6.2
+
+Tag: uploader-address-malformed
+Type: error
+Info: The uploader field could not be parsed according to the rules in
+ the Policy Manual.
+Ref: policy 5.6.2
+
+Tag: uploader-not-full-name
+Type: warning
+Info: The `name' part of this uploader field is just one word, so it
+ might not be a full name.
+
+Tag: uploader-address-looks-weird
+Type: warning
+Info: The uploader address does not have whitespace between the name
+ and the email address.
+
+Tag: uploader-address-is-on-localhost
+Type: error
+Info: The uploader address includes localhost(.localdomain), which is
+ an invalid e-mail address.
+Ref: policy 5.6.2
+
Tag: wrong-debian-qa-address-set-as-maintainer
Type: error
Info: Orphaned packages should no longer have the address
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2004-03-05 01:05:04 UTC (rev 89)
+++ trunk/debian/changelog 2004-03-05 03:41:20 UTC (rev 90)
@@ -72,8 +72,10 @@
* checks/binaries:
+ Exclude binaries and packages named *-static from the binary-is-static
test. Exception for sash removed (override case) (Closes: #215235)
+ * checks/fields:
+ + Test syntax of Uploaders: too
- -- Frank Lichtenheld <djpig@debian.org> Thu, 26 Feb 2004 21:52:14 +0100
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl> Fri, 5 Mar 2004 04:35:22 +0100
lintian (1.22.11) unstable; urgency=low
Modified: trunk/testset/foo++/debian/changelog
===================================================================
--- trunk/testset/foo++/debian/changelog 2004-03-05 01:05:04 UTC (rev 89)
+++ trunk/testset/foo++/debian/changelog 2004-03-05 03:41:20 UTC (rev 90)
@@ -1,3 +1,9 @@
+foo++ (3) unstable; urgency=low
+
+ * Set maintainers + uploaders incorrectly
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl> Fri, 5 Mar 2004 04:20:24 +0100
+
foo++ (2) unstable; urgency=low
* Added a foo++-helper package to try and catch even more ++ bugs.
Modified: trunk/testset/foo++/debian/control
===================================================================
--- trunk/testset/foo++/debian/control 2004-03-05 01:05:04 UTC (rev 89)
+++ trunk/testset/foo++/debian/control 2004-03-05 03:41:20 UTC (rev 90)
@@ -1,7 +1,10 @@
Source: foo++
Section: misc
Priority: optional
-Maintainer: Lintian Maintainer <lintian-maint@debian.org>
+Maintainer: Lintian Maintainer <debian-qa@lists.debian.org>
+Uploaders: Jeroen van Wolffelaar<jeroen@localhost.localdomain>,
+ Frank <djpig@debian.org>, Yama@gotchi, Josip, ,
+ I am afraid of spam and think this helps <no_spam_please AT debian.org>
Standards-Version: 3.1.1
Package: foo++
Modified: trunk/testset/info_tags.foo++
===================================================================
--- trunk/testset/info_tags.foo++ 2004-03-05 01:05:04 UTC (rev 89)
+++ trunk/testset/info_tags.foo++ 2004-03-05 03:41:20 UTC (rev 90)
@@ -9,6 +9,62 @@
N: Standards-Version control field. However, please remember to update
N: this field next time you upload the package.
N:
+E: foo++ source: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
+N:
+N: Orphaned packages should no longer have the address
+N: <debian-qa@lists.debian.org> in the Maintainer field.
+N:
+N: The correct Maintainer field for orphaned packages is Debian QA Group
+N: <packages@qa.debian.org>.
+N:
+N: Refer to Developers Reference, section 5.9.4 for details.
+N:
+E: foo++ source: multiline-field uploaders
+N:
+N: Most control fields must have only a single line of data.
+N:
+N: Refer to Policy Manual, section 5.1 for details.
+N:
+W: foo++ source: uploader-address-looks-weird Jeroen van Wolffelaar<jeroen@localhost.localdomain>
+N:
+N: The uploader address does not have whitespace between the name and the
+N: email address.
+N:
+E: foo++ source: uploader-address-is-on-localhost Jeroen van Wolffelaar<jeroen@localhost.localdomain>
+N:
+N: The uploader address includes localhost(.localdomain), which is an
+N: invalid e-mail address.
+N:
+N: Refer to Policy Manual, section 5.6.2 for details.
+N:
+W: foo++ source: uploader-not-full-name Frank
+N:
+N: The `name' part of this uploader field is just one word, so it might
+N: not be a full name.
+N:
+E: foo++ source: uploader-name-missing Yama@gotchi
+N:
+N: The uploader field seems to contain just an email address. It must
+N: contain the package uploader's name and email address.
+N:
+N: Refer to Policy Manual, section 5.6.2 for details.
+N:
+E: foo++ source: uploader-address-missing Josip
+N:
+N: The uploader field should contain the package uploader's name and
+N: email address, with the name followed by the address inside angle
+N: brackets (< and &rt;). The address seems to be missing.
+N:
+N: Refer to Policy Manual, section 5.6.2 for details.
+N:
+E: foo++ source: uploader-address-malformed I am afraid of spam and think this helps <no_spam_please AT debian.org>
+N:
+N: The uploader field could not be parsed according to the rules in the
+N: Policy Manual.
+N:
+N: Refer to Policy Manual, section 5.6.2 for details.
+N:
+E: foo++-helper: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
E: foo++: no-copyright-file
N:
N: Each binary package has to include a plain file
@@ -16,3 +72,4 @@
N:
N: Refer to Policy Manual, section 12.5 for details.
N:
+E: foo++: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
Modified: trunk/testset/tags.foo++
===================================================================
--- trunk/testset/tags.foo++ 2004-03-05 01:05:04 UTC (rev 89)
+++ trunk/testset/tags.foo++ 2004-03-05 03:41:20 UTC (rev 90)
@@ -1,2 +1,12 @@
W: foo++ source: ancient-standards-version 3.1.1
+E: foo++ source: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
+E: foo++ source: multiline-field uploaders
+W: foo++ source: uploader-address-looks-weird Jeroen van Wolffelaar<jeroen@localhost.localdomain>
+E: foo++ source: uploader-address-is-on-localhost Jeroen van Wolffelaar<jeroen@localhost.localdomain>
+W: foo++ source: uploader-not-full-name Frank
+E: foo++ source: uploader-name-missing Yama@gotchi
+E: foo++ source: uploader-address-missing Josip
+E: foo++ source: uploader-address-malformed I am afraid of spam and think this helps <no_spam_please AT debian.org>
+E: foo++-helper: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
E: foo++: no-copyright-file
+E: foo++: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
Reply to: