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

Bug#784012: lintian: Allow quoted distribution name when checking experimental-to-unstable-without-comment



Package: lintian
Version: 2.5.30+deb8u4
Severity: minor
Control: patch

Dear Maintainer,

The check for ‘experimental-to-unstable-without-comment’ uses a regex
that misses some obvious (to humans) instances of the phrase being
sought.

In particular, it is normal English to put a name in quotation marks,
for clarity. For example, I can talk about “unstable” by placing that
term in quotation marks.

But using a changelog entry like:

     * Resume our uploads to ‘unstable’ since the freeze has ended.

will fail to match the regex, which expects nothing but space between
“to” and “unstable”.

The attached patch refines the regex to allow a quoted distribution
name, and updates the tag description to more accurately describe the
criteria.

-- 
 \       “You can be a victor without having victims.” —Harriet Woods, |
  `\                                                         1927–2007 |
_o__)                                                                  |
Ben Finney <ben@benfinney.id.au>
The following changes since commit a0bac6cda42e8822aaf3c069cdfa82bb1fb4a30a:

  checks.pot: Update (2015-05-01 18:43:01 +0200)

are available in the git repository at:

  https://bull.codes/git/bignose/lintian/ 

for you to fetch changes up to c42a1efcd338d639e4e2adc67f9eaa24002cac15:

  Accurately describe criteria for ‘experimental-to-unstable-without-comment’. (2015-05-02 15:15:42 +1000)

----------------------------------------------------------------
Ben Finney (2):
      Allow quoting the distribution name in changelog entry.
      Accurately describe criteria for ‘experimental-to-unstable-without-comment’.

 checks/changelog-file.desc | 14 +++++++++-----
 checks/changelog-file.pm   |  5 ++++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/checks/changelog-file.desc b/checks/changelog-file.desc
index 1abb07f..9330822 100644
--- a/checks/changelog-file.desc
+++ b/checks/changelog-file.desc
@@ -223,11 +223,15 @@ Tag: experimental-to-unstable-without-comment
 Severity: pedantic
 Certainty: possible
 Info: The previous version of this package had a distribution of
- experimental, this version has a distribution of unstable, and there's
- apparently no comment about the change of distributions (Lintian looks
- for the phrase "to unstable").  This may indicate a mistake in setting
- the distribution and accidentally uploading to unstable a package
- intended for experimental.
+ "experimental", this version has a distribution of "unstable", and there's
+ apparently no comment about the change of distributions.
+ .
+ Lintian looks in this version's changelog entry for the phrase "to
+ unstable" or "to sid", with or without quotation marks around the
+ distribution name.
+ .
+ This may indicate a mistake in setting the distribution and accidentally
+ uploading to unstable a package intended for experimental.
 
 Tag: syntax-error-in-debian-changelog
 Severity: normal
diff --git a/checks/changelog-file.pm b/checks/changelog-file.pm
index a5d0e07..e641c57 100644
--- a/checks/changelog-file.pm
+++ b/checks/changelog-file.pm
@@ -323,7 +323,10 @@ sub run {
             my $first_dist = lc $entries[0]->Distribution;
             my $second_dist = lc $entries[1]->Distribution;
             if ($first_dist eq 'unstable' and $second_dist eq 'experimental') {
-                unless ($entries[0]->Changes =~ /\bto\s+(?:unstable|sid)\b/im){
+                unless (
+                        $entries[0]->Changes
+                            =~ /\bto\s+['"‘“]?(?:unstable|sid)['"’”]?\b/im
+                        ) {
                     tag 'experimental-to-unstable-without-comment';
                 }
             }

Attachment: signature.asc
Description: Digital signature


Reply to: