[lintian] 03/03: Correct operator precedence in "epoch-change-without-comment" to prevent a false positive when an epoch is present but is unchanged between versions.
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit f4568845d3e649b03261119a1244e485f79b9209
Author: Chris Lamb <lamby@debian.org>
Date: Wed Dec 6 20:10:06 2017 +0000
Correct operator precedence in "epoch-change-without-comment" to prevent a false positive when an epoch is present but is unchanged between versions.
---
checks/changelog-file.pm | 2 +-
debian/changelog | 4 ++++
.../debian/debian/changelog.in | 11 +++++++++++
t/tests/changelog-file-epoch-change-without-comment-same/desc | 5 +++++
t/tests/changelog-file-epoch-change-without-comment-same/tags | 0
5 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/checks/changelog-file.pm b/checks/changelog-file.pm
index 5191b47..cd7b9a7 100644
--- a/checks/changelog-file.pm
+++ b/checks/changelog-file.pm
@@ -346,7 +346,7 @@ sub run {
my ($first_epoch) = $first_version =~ /^([^:]+):/;
my ($second_epoch) = $second_version =~ /^([^:]+):/;
- if ($first_epoch and $second_epoch // '' ne $first_epoch) {
+ if ($first_epoch and ($second_epoch // '') ne $first_epoch) {
tag 'epoch-change-without-comment',
unless $entries[0]->Changes =~ /\bepoch\b/im;
}
diff --git a/debian/changelog b/debian/changelog
index 79b7cd9..c456552 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,10 @@ lintian (2.5.62) UNRELEASED; urgency=medium
XXX: generate tag summary
+ * checks/changelog-file.pm:
+ + [CL] Correct operator precedence in "epoch-change-without-comment"
+ to prevent a false positive when an epoch is present but is unchanged
+ between versions.
* checks/python.desc:
+ [CL] Also match, for example, "python2.7:any" when checking the
"dependency-on-python-version-marked-for-end-of-life" tag, not just
diff --git a/t/tests/changelog-file-epoch-change-without-comment-same/debian/debian/changelog.in b/t/tests/changelog-file-epoch-change-without-comment-same/debian/debian/changelog.in
new file mode 100644
index 0000000..6df139a
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment-same/debian/debian/changelog.in
@@ -0,0 +1,11 @@
+{$source} (2:{$version}) unstable; urgency=low
+
+ * This changelog entry has the same prefix as before.
+
+ -- {$author} {$date}
+
+{$source} (2:0) 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-same/desc b/t/tests/changelog-file-epoch-change-without-comment-same/desc
new file mode 100644
index 0000000..377a7b4
--- /dev/null
+++ b/t/tests/changelog-file-epoch-change-without-comment-same/desc
@@ -0,0 +1,5 @@
+Testname: changelog-file-epoch-change-without-comment-same
+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-same/tags b/t/tests/changelog-file-epoch-change-without-comment-same/tags
new file mode 100644
index 0000000..e69de29
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: