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

lamby pushed a commit to branch master
in repository lintian.

commit 425c2f8ef19e53aa90b12292803818d29a99ab19
Author: Chris Lamb <la...@debian.org>
Date:   Mon Apr 9 19:36:12 2018 +0100

    Add support for derivative-specific version validation to permit 
enforcement of additional restrictions on the version number.
---
 checks/changes-file.desc                                  | 10 ++++++++++
 checks/changes-file.pm                                    | 10 ++++++++++
 data/changes-file/derivative-versions                     |  5 +++++
 debian/changelog                                          |  4 ++++
 vendors/pureos/main/data/changes-file/derivative-versions |  1 +
 5 files changed, 30 insertions(+)

diff --git a/checks/changes-file.desc b/checks/changes-file.desc
index 55dacb3..5919f52 100644
--- a/checks/changes-file.desc
+++ b/checks/changes-file.desc
@@ -206,3 +206,13 @@ Info: The packaging includes an upstream signing key but 
the corresponding
  .
  Support for signatures was added to <tt>pristine-tar</tt> in version 1.41
  and support in <tt>git-buildpackage</tt> is being tracked in #872864.
+
+Tag: invalid-version-number-for-derivative
+Severity: serious
+Certainty: certain
+Info: The version number for this package does not comply with the
+ required format for this Debian derivative.
+ .
+ Derivative distributions of Debian may enforce additional restrictions
+ on the version in order to ensure that forked (or packages that are
+ otherwise modified) are marked as such.
diff --git a/checks/changes-file.pm b/checks/changes-file.pm
index 6ca14e4..bed1a87 100644
--- a/checks/changes-file.pm
+++ b/checks/changes-file.pm
@@ -32,6 +32,8 @@ use Lintian::Util qw(get_file_checksum);
 
 my $KNOWN_DISTS = Lintian::Data->new('changes-file/known-dists');
 my $SIGNING_KEY_FILENAMES = Lintian::Data->new('common/signing-key-filenames');
+my $DERIVATIVE_VERSIONS= Lintian::Data->new('changes-file/derivative-versions',
+    qr/\s*~~\s*/, sub { $_[1]; });
 
 sub run {
     my (undef, undef, $info, undef, $group) = @_;
@@ -254,6 +256,14 @@ sub run {
           if $seen != $expected;
     }
 
+    # Check version field
+    my $version = $info->field('version');
+    foreach my $re ($DERIVATIVE_VERSIONS->all) {
+        next if $version =~ m/$re/;
+        my $explanation = $DERIVATIVE_VERSIONS->value($re);
+        tag 'invalid-version-number-for-derivative', $version,"($explanation)";
+    }
+
     return;
 }
 
diff --git a/data/changes-file/derivative-versions 
b/data/changes-file/derivative-versions
new file mode 100644
index 0000000..02fd409
--- /dev/null
+++ b/data/changes-file/derivative-versions
@@ -0,0 +1,5 @@
+# Derivative-specific version number validation
+#
+# format: $regex ~~ explanation
+
+.      ~~      always matches
diff --git a/debian/changelog b/debian/changelog
index f06645b..cd5166b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,10 @@ lintian (2.5.82) UNRELEASED; urgency=medium
 
   XXX: generate tag summary
 
+  * checks/changes-file.{desc,pm}:
+    + [CL] Add support for derivative-specific version validation to permit
+      enforcement of additional restrictions on the version number such as
+      being suffixed by "derivativeos1", etc.
   * checks/debhelper.pm:
     + [CL] Add a special case for the python3 addon as it needs a
       dependency on dh-python unless the -dev packages are used.
diff --git a/vendors/pureos/main/data/changes-file/derivative-versions 
b/vendors/pureos/main/data/changes-file/derivative-versions
new file mode 100644
index 0000000..7cf86d2
--- /dev/null
+++ b/vendors/pureos/main/data/changes-file/derivative-versions
@@ -0,0 +1 @@
+pureos\d+$     ~~      must end with pureosX

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

Reply via email to