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

[SCM] Debian package checker branch, master, updated. 2.1.5-8-gca4afc3



The following commit has been merged in the master branch:
commit ca4afc31b9644b5a7bd1d92c3f12014e8ac31129
Author: Russ Allbery <rra@debian.org>
Date:   Sun Jan 11 11:54:10 2009 -0800

    Supress NMU warnings for local packages
    
    * checks/nmu{,.desc}:
      + [RA] Suppress NMU warnings for packages with "local" in the version
        number or "local package" in the first line of the changelog.
        Thanks, Zack Weinberg.  (Closes: #501523)

diff --git a/checks/nmu b/checks/nmu
index 5122869..326ac93 100644
--- a/checks/nmu
+++ b/checks/nmu
@@ -32,6 +32,7 @@ my $type = shift;
 my $info = shift;
 my $distribution = undef;
 my $changelog_mentions_nmu = 0;
+my $changelog_mentions_local = 0;
 my $changelog_mentions_qa = 0;
 my $uploader = undef;
 
@@ -52,6 +53,7 @@ while (<CHANGELOG>) {
 	if ($firstline) {
 		$changelog_mentions_nmu = 1
 			if (/\bnmu\b/i or /non-maintainer upload/i) and not /(ackno|\back\b|confir|incorporat)/i;
+		$changelog_mentions_local = 1 if /\blocal\s+package\b/i;
 		$changelog_mentions_qa = 1 if /orphan/i or /qa (?:group )?upload/i;
 		$firstline = 0 if /^\s+\S/;
 	}
@@ -67,6 +69,7 @@ my $maintainer = canonicalize($info->field("maintainer"));
 my $uploaders = $info->field("uploaders");
 
 my $version_nmuness = 0;
+my $version_local = 0;
 if ($version =~ /-[^.-]+(\.[^.-]+)?(\.[^.-]+)?$/) {
 	$version_nmuness = 1 if defined $1;
 	$version_nmuness = 2 if defined $2;
@@ -77,6 +80,9 @@ if ($version =~ /\+nmu\d+$/) {
 if ($version =~ /\+b\d+$/) {
 	$version_nmuness = 2;
 }
+if ($version =~ /local/i) {
+	$version_local = 1;
+}
 
 my $upload_is_nmu = $uploader ne $maintainer;
 if (defined $uploaders) {
@@ -100,12 +106,15 @@ if ($maintainer =~ /packages\@qa.debian.org/) {
 	tag "changelog-should-mention-qa", ""
 		if !$changelog_mentions_qa;
 } else {
-	tag "changelog-should-mention-nmu", ""
-		if !$changelog_mentions_nmu && $upload_is_nmu;
+	# Local packages may be either NMUs or not.
+	unless ($changelog_mentions_local || $version_local) {
+		tag "changelog-should-mention-nmu", ""
+		    if !$changelog_mentions_nmu && $upload_is_nmu;
+		tag "source-nmu-has-incorrect-version-number", "$version"
+		    if $upload_is_nmu && $version_nmuness != 1;
+	}
 	tag "changelog-should-not-mention-nmu", ""
 		if $changelog_mentions_nmu && !$upload_is_nmu;
-	tag "source-nmu-has-incorrect-version-number", "$version"
-		if $upload_is_nmu && $version_nmuness != 1;
 	tag "maintainer-upload-has-incorrect-version-number", "$version"
 		if !$upload_is_nmu && $version_nmuness;
 }
diff --git a/checks/nmu.desc b/checks/nmu.desc
index b9a0dfa..9603e5b 100644
--- a/checks/nmu.desc
+++ b/checks/nmu.desc
@@ -28,7 +28,10 @@ Info: A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
  .
  Maybe you didn't intend this upload to be a NMU, in that case, please
  doublecheck that the most recent entry in the changelog is byte-for-byte
- identical to the maintainer or one of the uploaders.
+ identical to the maintainer or one of the uploaders.  If this is a local
+ package (not intended for Debian), you can suppress this warning by
+ putting "local" in the version number or "local package" on the first
+ line of the changelog entry.
 Ref: devref 5.11.2
 
 Tag: maintainer-upload-has-incorrect-version-number
@@ -55,7 +58,10 @@ Info: When you NMU a package, that fact should be mentioned on the first line
  .
  Maybe you didn't intend this upload to be a NMU, in that case, please
  doublecheck that the most recent entry in the changelog is byte-for-byte
- identical to the maintainer or one of the uploaders.
+ identical to the maintainer or one of the uploaders.  If this is a local
+ package (not intended for Debian), you can suppress this warning by
+ putting "local" in the version number or "local package" on the first
+ line of the changelog entry.
 Ref: devref 5.11.3
 
 Tag: changelog-should-not-mention-nmu
diff --git a/debian/changelog b/debian/changelog
index 4694cc2..e8ee9ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,10 @@ lintian (2.1.6) UNRELEASED; urgency=low
       Holger Levsen and Chris Lamb.  (Closes: #464837)
   * checks/lintian.desc:
     + [RA] Add tag description for malformed-changes-file.
+  * checks/nmu{,.desc}:
+    + [RA] Suppress NMU warnings for packages with "local" in the version
+      number or "local package" in the first line of the changelog.
+      Thanks, Zack Weinberg.  (Closes: #501523)
 
   * frontend/lintian:
     + [RA] Check that .changes files have at least a Format key.  If not,
diff --git a/t/tests/6000_nmu-local-changelog.desc b/t/tests/6000_nmu-local-changelog.desc
new file mode 100644
index 0000000..2c256f9
--- /dev/null
+++ b/t/tests/6000_nmu-local-changelog.desc
@@ -0,0 +1,7 @@
+Testname: nmu-local-changelog
+Version: 1.0
+Description: Test suppression of NMU tags for local packages
+Test-Against:
+ changelog-should-mention-nmu
+ source-nmu-has-incorrect-version-number
+References: Debian Bug#501523
diff --git a/t/tests/6000_nmu-local-version.desc b/t/tests/6000_nmu-local-version.desc
new file mode 100644
index 0000000..029d071
--- /dev/null
+++ b/t/tests/6000_nmu-local-version.desc
@@ -0,0 +1,7 @@
+Testname: nmu-local-version
+Version: 1.0local1
+Description: Test suppression of NMU tags for local packages
+Test-Against:
+ changelog-should-mention-nmu
+ source-nmu-has-incorrect-version-number
+References: Debian Bug#501523
diff --git a/t/templates/skel/debian/changelog.in b/t/tests/nmu-local-changelog/debian/debian/changelog.in
similarity index 71%
copy from t/templates/skel/debian/changelog.in
copy to t/tests/nmu-local-changelog/debian/debian/changelog.in
index f6d86c0..f66255f 100644
--- a/t/templates/skel/debian/changelog.in
+++ b/t/tests/nmu-local-changelog/debian/debian/changelog.in
@@ -1,8 +1,9 @@
 {$srcpkg} ({$version}) unstable; urgency=low
 
+  * Local package.
   * Lintian Test Suite.
   * Test: {$testname}
 
   * Suppress "should close ITP bug" messages.  (Closes: #123456)
 
- -- {$author}  {$date}
+ -- Russ Allbery <rra@debian.org>  {$date}
diff --git a/t/tests/basic-non-native/tags b/t/tests/nmu-local-changelog/tags
similarity index 100%
copy from t/tests/basic-non-native/tags
copy to t/tests/nmu-local-changelog/tags
diff --git a/t/templates/skel/debian/changelog.in b/t/tests/nmu-local-version/debian/debian/changelog.in
similarity index 78%
copy from t/templates/skel/debian/changelog.in
copy to t/tests/nmu-local-version/debian/debian/changelog.in
index f6d86c0..d48bf4d 100644
--- a/t/templates/skel/debian/changelog.in
+++ b/t/tests/nmu-local-version/debian/debian/changelog.in
@@ -5,4 +5,4 @@
 
   * Suppress "should close ITP bug" messages.  (Closes: #123456)
 
- -- {$author}  {$date}
+ -- Russ Allbery <rra@debian.org>  {$date}
diff --git a/t/tests/basic-non-native/tags b/t/tests/nmu-local-version/tags
similarity index 100%
copy from t/tests/basic-non-native/tags
copy to t/tests/nmu-local-version/tags

-- 
Debian package checker


Reply to: