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

[SCM] Debian package checker branch, master, updated. 2.3.0-52-ge9da66c



The following commit has been merged in the master branch:
commit e9da66cfef563e155a55cedd109e29cfca4cb193
Author: Russ Allbery <rra@debian.org>
Date:   Fri Jan 1 22:11:23 2010 -0800

    Warn if the NEWS.Debian version doesn't appear in changelog
    
    * checks/changelog-file{,.desc}:
      + [RA] Warn if the version of the latest NEWS.Debian entry doesn't
        appear in the changelog.  Thanks, Christoph Berg.  (Closes: #550594)

diff --git a/checks/changelog-file b/checks/changelog-file
index a9d1ba8..b88f09e 100644
--- a/checks/changelog-file
+++ b/checks/changelog-file
@@ -280,14 +280,16 @@ if (my @errors = $changes->get_parse_errors) {
 
 my @entries = $changes->data;
 if (@entries) {
-    foreach (@entries) {
-	if ($_->Maintainer) {
-	    if ($_->Maintainer =~ /<([^>\@]+\@unknown)>/) {
+    my %versions;
+    for my $entry (@entries) {
+	if ($entry->Maintainer) {
+	    if ($entry->Maintainer =~ /<([^>\@]+\@unknown)>/) {
 		tag "debian-changelog-file-contains-debmake-default-email-address", $1;
-	    } elsif ($_->Maintainer =~ /<([^>\@]+\@[^>.]*)>/) {
+	    } elsif ($entry->Maintainer =~ /<([^>\@]+\@[^>.]*)>/) {
 		tag "debian-changelog-file-contains-invalid-email-address", $1;
 	    }
 	}
+	$versions{$entry->Version} = 1;
     }
 
     if (@entries > 1) {
@@ -361,13 +363,18 @@ if (@entries) {
     }
 
     # Compare against NEWS.Debian if available.
-    if ($news and $news->Version 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;
-            }
-        }
+    if ($news and $news->Version) {
+	if ($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;
+		}
+	    }
+	}
+	unless ($versions{$news->Version}) {
+	    tag 'debian-news-entry-has-unknown-version', $news->Version;
+	}
     }
 
     # We have to decode into UTF-8 to get the right length for the length
diff --git a/checks/changelog-file.desc b/checks/changelog-file.desc
index 19f98b1..166bfa9 100644
--- a/checks/changelog-file.desc
+++ b/checks/changelog-file.desc
@@ -283,6 +283,15 @@ Info: There appears to be no blank line after the most recent
  blank line (which, if this is the only entry in the file, may mean adding
  a trailing blank line).
 
+Tag: debian-news-entry-has-unknown-version
+Severity: normal
+Certainty: possible
+Info: The version number of the most recent <tt>NEWS.Debian</tt> entry
+ does not match any of the version numbers in the changelog file for this
+ package.  This usually means the version in <tt>NEWS.Debian</tt> needs to
+ be updated to match a change to package version that happened after the
+ <tt>NEWS.Debian</tt> entry was written.
+
 Tag: spelling-error-in-changelog
 Severity: minor
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index a82beeb..327bff6 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,8 @@ lintian (2.3.1) UNRELEASED; urgency=low
     + [RA] Check that the most recent NEWS.Debian entry is followed by a
       blank line for apt-listchanges.  Thanks, Adeodato Simó.  (Addresses
       the Lintian part of #523436)
+    + [RA] Warn if the version of the latest NEWS.Debian entry doesn't
+      appear in the changelog.  Thanks, Christoph Berg.  (Closes: #550594)
   * checks/cruft:
     + [RA] Fix the regex to properly ignore CMakeCache.txt in the debian
       directory.  Thanks, Aaron M. Ucko.  (Closes: #553264)
diff --git a/t/tests/changelog-file-news-version/debian/debian/NEWS b/t/tests/changelog-file-news-version/debian/debian/NEWS
new file mode 100644
index 0000000..a4be560
--- /dev/null
+++ b/t/tests/changelog-file-news-version/debian/debian/NEWS
@@ -0,0 +1,6 @@
+changelog-file-news-version (2.0) unstable; urgency=low
+
+  This is some news entry about something.
+
+ -- Russ Allbery <rra@debian.org>  Fri, 01 Jan 2010 22:09:12 -0800
+
diff --git a/t/tests/changelog-file-news-version/desc b/t/tests/changelog-file-news-version/desc
new file mode 100644
index 0000000..a4ec312
--- /dev/null
+++ b/t/tests/changelog-file-news-version/desc
@@ -0,0 +1,5 @@
+Testname: changelog-file-news-version
+Sequence: 6000
+Version: 1.0
+Description: Check mismatches of the NEWS.Debian version
+Test-For: debian-news-entry-has-unknown-version
diff --git a/t/tests/changelog-file-news-version/tags b/t/tests/changelog-file-news-version/tags
new file mode 100644
index 0000000..ebd4ba3
--- /dev/null
+++ b/t/tests/changelog-file-news-version/tags
@@ -0,0 +1 @@
+W: changelog-file-news-version: debian-news-entry-has-unknown-version 2.0

-- 
Debian package checker


Reply to: