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

[lintian] 01/01: Warn about packages that modify the epoch and there's no comment about the change. This was motivated by accidental bumping of the epoch in my python-django 2:2.0-1 upload.



This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit 36e98d16168308157a10b2d54ae89f5d65113962
Author: Chris Lamb <lamby@debian.org>
Date:   Mon Dec 4 09:03:23 2017 +0000

    Warn about packages that modify the epoch and there's no comment about the change. This was motivated by accidental bumping of the epoch in my python-django 2:2.0-1 upload.
---
 checks/changelog-file.desc                                   | 11 +++++++++++
 checks/changelog-file.pm                                     |  7 +++++++
 debian/changelog                                             |  4 ++++
 .../debian/debian/changelog.in                               | 11 +++++++++++
 t/tests/changelog-file-epoch-change-without-comment-new/desc |  5 +++++
 t/tests/changelog-file-epoch-change-without-comment-new/tags |  1 +
 .../debian/debian/changelog.in                               | 12 ++++++++++++
 .../changelog-file-epoch-change-without-comment-unrel/desc   |  5 +++++
 .../changelog-file-epoch-change-without-comment-unrel/tags   |  0
 .../debian/debian/changelog.in                               | 11 +++++++++++
 t/tests/changelog-file-epoch-change-without-comment/desc     |  5 +++++
 t/tests/changelog-file-epoch-change-without-comment/tags     |  1 +
 12 files changed, 73 insertions(+)

diff --git a/checks/changelog-file.desc b/checks/changelog-file.desc
index 07b4346..925e3c0 100644
--- a/checks/changelog-file.desc
+++ b/checks/changelog-file.desc
@@ -420,3 +420,14 @@ Info: The changelog entry references a temporary security identifier,
  please replace the TEMP identifier with a short description of the
  issue.
 Ref: #787929, #807892
+
+Tag: epoch-change-without-comment
+Severity: normal
+Certainty: possible
+Info: The previous version of this package had a different version epoch
+ (eg. 2:1.0-1) to the current version and there's no reference to this in
+ the changelog entry.
+ .
+ This may indicate a mistake in setting the version.
+ .
+ Lintian looks in this version's changelog entry for the phrase "epoch".
diff --git a/checks/changelog-file.pm b/checks/changelog-file.pm
index 806cefe..5191b47 100644
--- a/checks/changelog-file.pm
+++ b/checks/changelog-file.pm
@@ -343,6 +343,13 @@ sub run {
                     tag 'experimental-to-unstable-without-comment';
                 }
             }
+
+            my ($first_epoch) = $first_version =~ /^([^:]+):/;
+            my ($second_epoch) = $second_version =~ /^([^:]+):/;
+            if ($first_epoch and $second_epoch // '' ne $first_epoch) {
+                tag 'epoch-change-without-comment',
+                  unless $entries[0]->Changes =~ /\bepoch\b/im;
+            }
         }
 
         # Some checks should only be done against the most recent
diff --git a/debian/changelog b/debian/changelog
index 187fa2c..4c53cdb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,10 @@ lintian (2.5.61) UNRELEASED; urgency=medium
 
   XXX: generate tag summary
 
+  * checks/changelog-file.{desc,pm}:
+    + [CL] Warn about packages that modify the epoch and there's no comment
+      about the change. This was motivated by accidental bumping of the
+      epoch in my python-django 2:2.0-1 upload.
   * checks/elpa.desc:
     + [CL] Correct reference to dh_elpa(1) manpage. Thanks to Paul Gevers
       for the report.  (Closes: #883356)
diff --git a/t/tests/changelog-file-epoch-change-without-comment-new/debian/debian/changelog.in b/t/tests/changelog-file-epoch-change-without-comment-new/debian/debian/changelog.in
new file mode 100644
index 0000000..2200c19
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment-new/debian/debian/changelog.in
@@ -0,0 +1,11 @@
+{$source} (1:{$version}) unstable; urgency=low
+
+  * This changelog entry introduces a version prefix.
+
+ -- {$author}  {$date}
+
+{$source} ({$version}) unstable; urgency=low
+
+  * Initial upload.
+
+ -- {$author}  Fri, 06 Feb 2009 22:22:37 -0800
diff --git a/t/tests/changelog-file-epoch-change-without-comment-new/desc b/t/tests/changelog-file-epoch-change-without-comment-new/desc
new file mode 100644
index 0000000..11040f6
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment-new/desc
@@ -0,0 +1,5 @@
+Testname: changelog-file-epoch-change-without-comment-new
+Version: 1.0
+Description: Check changelog for accidental epoch changes
+Test-For:
+ epoch-change-without-comment
diff --git a/t/tests/changelog-file-epoch-change-without-comment-new/tags b/t/tests/changelog-file-epoch-change-without-comment-new/tags
new file mode 100644
index 0000000..37727db
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment-new/tags
@@ -0,0 +1 @@
+W: changelog-file-epoch-change-without-comment-new: epoch-change-without-comment
diff --git a/t/tests/changelog-file-epoch-change-without-comment-unrel/debian/debian/changelog.in b/t/tests/changelog-file-epoch-change-without-comment-unrel/debian/debian/changelog.in
new file mode 100644
index 0000000..0a3023c
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment-unrel/debian/debian/changelog.in
@@ -0,0 +1,12 @@
+{$source} (2:{$version}) unstable; urgency=low
+
+  * This changelog entry bumps the epoch and references the word in the
+    changelog.
+
+ -- {$author}  {$date}
+
+{$source} (1:{$version}) unstable; urgency=low
+
+  * Initial upload.
+
+ -- {$author}  Fri, 06 Feb 2009 22:22:37 -0800
diff --git a/t/tests/changelog-file-epoch-change-without-comment-unrel/desc b/t/tests/changelog-file-epoch-change-without-comment-unrel/desc
new file mode 100644
index 0000000..1e5bf88
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment-unrel/desc
@@ -0,0 +1,5 @@
+Testname: changelog-file-epoch-change-without-comment-unrel
+Version: 1.0
+Description: Check changelog for accidental epoch changes (false positive)
+Test-Against:
+ epoch-change-without-comment
diff --git a/t/tests/changelog-file-epoch-change-without-comment-unrel/tags b/t/tests/changelog-file-epoch-change-without-comment-unrel/tags
new file mode 100644
index 0000000..e69de29
diff --git a/t/tests/changelog-file-epoch-change-without-comment/debian/debian/changelog.in b/t/tests/changelog-file-epoch-change-without-comment/debian/debian/changelog.in
new file mode 100644
index 0000000..87cc63c
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment/debian/debian/changelog.in
@@ -0,0 +1,11 @@
+{$source} (2:{$version}) unstable; urgency=low
+
+  * This changelog entry bumps the version.
+
+ -- {$author}  {$date}
+
+{$source} (1:{$version}) unstable; urgency=low
+
+  * Initial upload.
+
+ -- {$author}  Fri, 06 Feb 2009 22:22:37 -0800
diff --git a/t/tests/changelog-file-epoch-change-without-comment/desc b/t/tests/changelog-file-epoch-change-without-comment/desc
new file mode 100644
index 0000000..963db25
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment/desc
@@ -0,0 +1,5 @@
+Testname: changelog-file-epoch-change-without-comment
+Version: 1.0
+Description: Check changelog for accidental epoch changes
+Test-For:
+ epoch-change-without-comment
diff --git a/t/tests/changelog-file-epoch-change-without-comment/tags b/t/tests/changelog-file-epoch-change-without-comment/tags
new file mode 100644
index 0000000..0cfc503
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment/tags
@@ -0,0 +1 @@
+W: changelog-file-epoch-change-without-comment: epoch-change-without-comment

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: