lintian: r1175 - in trunk: checks debian testset testset/binary/debian
Author: rra
Date: 2008-02-05 03:17:28 +0100 (Tue, 05 Feb 2008)
New Revision: 1175
Modified:
trunk/checks/changelog-file
trunk/checks/changelog-file.desc
trunk/debian/changelog
trunk/testset/binary/debian/NEWS.Debian
trunk/testset/tags.binary
Log:
+ [RA] Check for mismatches between the latest changelog and
NEWS.Debian entries if they're for the same package version.
Thanks, Cyril Brulebois. (Closes: #461823)
Modified: trunk/checks/changelog-file
===================================================================
--- trunk/checks/changelog-file 2008-02-05 01:56:49 UTC (rev 1174)
+++ trunk/checks/changelog-file 2008-02-05 02:17:28 UTC (rev 1175)
@@ -156,7 +156,9 @@
# Check a NEWS.Debian file if we have one. We should additionally check here
# that the entries don't begin with an asterisk, but that hasn't been done
-# yet.
+# yet. Save the version, distribution, and urgency for later checks against
+# the changelog file.
+my $news;
if (-f 'NEWS.Debian') {
my $line = file_is_encoded_in_non_utf8('NEWS.Debian', $type, $pkg);
if ($line) {
@@ -171,11 +173,11 @@
# Some checks on the most recent entry.
if ($changes->data) {
- my ($entry) = $changes->data;
- if ($entry->Distribution =~ /unreleased/i) {
- tag "debian-news-entry-has-strange-distribution", $entry->Distribution;
+ ($news) = $changes->data;
+ if ($news->Distribution =~ /unreleased/i) {
+ tag "debian-news-entry-has-strange-distribution", $news->Distribution;
}
- spelling_check('spelling-error-in-news-debian', $entry->Changes);
+ spelling_check('spelling-error-in-news-debian', $news->Changes);
}
}
@@ -305,10 +307,8 @@
or $entries[0]->Changes =~ /backport/i;
}
}
-}
-# Some checks should only be done against the most recent changelog entry.
-if (@entries) {
+ # Some checks should only be done against the most recent changelog entry.
my $entry = $entries[0];
if (@entries == 1 and $entry->Version =~ /-1$/) {
tag 'new-package-should-close-itp-bug'
@@ -319,6 +319,16 @@
tag "possible-missing-colon-in-closes", "$1" if $1;
}
+ # Compare against NEWS.Debian if available.
+ if ($news and $entry->Version eq $news->Version) {
+ for my $field (qw/Distribution Urgency/) {
+ if ($entry->$field ne $news->$field) {
+ tag 'changelog-news-debian-mismatch', lc ($field),
+ $entry->$field . ' != ' . $news->$field;
+ }
+ }
+ }
+
# We have to decode into UTF-8 to get the right length for the length
# check. For some reason, use open ':utf8' isn't sufficient. If the
# changelog uses a non-UTF-8 encoding, this will mangle it, but it doesn't
Modified: trunk/checks/changelog-file.desc
===================================================================
--- trunk/checks/changelog-file.desc 2008-02-05 01:56:49 UTC (rev 1174)
+++ trunk/checks/changelog-file.desc 2008-02-05 02:17:28 UTC (rev 1175)
@@ -227,3 +227,10 @@
Such changelog entries may look poor in terminal windows and mail
messages and be annoying to read. Please wrap changelog entries at 80
columns or less where possible.
+
+Tag: changelog-news-debian-mismatch
+Type: warning
+Info: The latest entries in the Debian changelog file and NEWS.Debian file
+ are for the same version but the given field doesn't match. The
+ changelog information is canonical and the NEWS.Debian information is
+ ignored, but it may be confusing to users to have them be different.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2008-02-05 01:56:49 UTC (rev 1174)
+++ trunk/debian/changelog 2008-02-05 02:17:28 UTC (rev 1175)
@@ -11,6 +11,9 @@
* checks/changelog-file:
+ [RA] Decode the changelog entry from UTF-8 before doing length
checks. Thanks, Cyril Brulebois. (Closes: #461822)
+ + [RA] Check for mismatches between the latest changelog and
+ NEWS.Debian entries if they're for the same package version.
+ Thanks, Cyril Brulebois. (Closes: #461823)
* checks/common_data.pm:
+ [RA] Add Bugs, Origin, and Breaks to known binary and udeb fields
and Bugs to known source fields, matching current dpkg. Thanks,
Modified: trunk/testset/binary/debian/NEWS.Debian
===================================================================
--- trunk/testset/binary/debian/NEWS.Debian 2008-02-05 01:56:49 UTC (rev 1174)
+++ trunk/testset/binary/debian/NEWS.Debian 2008-02-05 02:17:28 UTC (rev 1175)
@@ -1,4 +1,4 @@
-binary (4-1.1) UNRELEASED; urgency=low
+binary (4-1.1) UNRELEASED; urgency=high
This is a Debian NEWS entry that isn't encoded properly in UTF-8: �It also has a usefull speling error.
Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary 2008-02-05 01:56:49 UTC (rev 1174)
+++ trunk/testset/tags.binary 2008-02-05 02:17:28 UTC (rev 1175)
@@ -64,6 +64,8 @@
W: binary: binary-without-manpage usr/bin/iminusrbin
W: binary: binary-without-manpage usr/bin/static-hello
W: binary: changelog-file-not-compressed changelog
+W: binary: changelog-news-debian-mismatch distribution unstable != UNRELEASED
+W: binary: changelog-news-debian-mismatch urgency low != high
W: binary: debian-copyright-file-uses-obsolete-national-encoding at line 13
W: binary: debian-news-entry-has-strange-distribution UNRELEASED
W: binary: description-contains-homepage
Reply to: