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

Bug#906155: lintian: should raise an error if a changes file's Version includes ~bpo but Distribution isn't *-backports



Package: lintian
Version: 2.5.50.4
Severity: wishlist

>From time to time uploads intended at stable-backports end up in
stable-proposed-updates due to incorrect Distribution in .changes.
lintian should be able to flag that as an error.  Something like the
below, maybe (+ tests)?

Cheers,
Julien

diff --git a/checks/changes-file.desc b/checks/changes-file.desc
index 1a668853d..2c2ab17a4 100644
--- a/checks/changes-file.desc
+++ b/checks/changes-file.desc
@@ -154,6 +154,12 @@ Info: The version number doesn't comply with the standard backport version
  the target distribution.
 Ref: http://backports.debian.org/Contribute/
 
+Tag: upload-has-backports-version-number
+Severity: serious
+Certainty: certain
+Info: The version number looks like a backport, but the upload's target
+ distribution is not a backport suite.
+
 Tag: distribution-and-changes-mismatch
 Severity: normal
 Certainty: possible
diff --git a/checks/changes-file.pm b/checks/changes-file.pm
index 478bbe33d..46746b5c0 100644
--- a/checks/changes-file.pm
+++ b/checks/changes-file.pm
@@ -119,6 +119,13 @@ sub run {
                                 tag 'backports-changes-missing';
                             }
                         }
+                    } else {
+                        if ($info->field('version') =~ m/~bpo(\d+)\+(\d+)$/) {
+                            tag
+                              'upload-has-backports-version-number',
+                              $info->field('version'),
+                              $distribution;
+                        }
                     }
                 }
                 if (!$KNOWN_DISTS->known($dist)) {


Reply to: