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

[lintian] 01/01: Add $info->is_repacked_tarball utility. (Refs: #871957)



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

lamby pushed a commit to branch master
in repository lintian.

commit 13dee7b911b66e1f48d61401b17227bd48680115
Author: Chris Lamb <lamby@debian.org>
Date:   Sun Sep 10 19:00:29 2017 +0100

    Add $info->is_repacked_tarball utility. (Refs: #871957)
---
 checks/changes-file.pm        |  2 +-
 checks/rules.pm               |  2 +-
 debian/changelog              |  2 ++
 lib/Lintian/Collect/Source.pm | 19 +++++++++++++++++++
 4 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/checks/changes-file.pm b/checks/changes-file.pm
index d8254a9..63d325c 100644
--- a/checks/changes-file.pm
+++ b/checks/changes-file.pm
@@ -199,7 +199,7 @@ sub run {
         if (   $has_signing_key
             && $file =~ m/\.orig(-[A-Za-z\d-]+)?\.tar\./
             && $file !~ m/\.asc$/
-            && $info->field('version') !~ m/(?:dfsg|debian|ds|repack)/) {
+            && !$info->is_repacked_tarball) {
             next if exists $files->{"$file.asc"};
             tag 'orig-tarball-missing-upstream-signature', $file;
         }
diff --git a/checks/rules.pm b/checks/rules.pm
index 2d73da8..9472c9e 100644
--- a/checks/rules.pm
+++ b/checks/rules.pm
@@ -382,7 +382,7 @@ sub run {
                 } elsif ($typerule eq 'recommended_allindep') {
                     tag 'debian-rules-missing-recommended-target', $target;
                 } elsif ($typerule eq 'goodpractice_dfsg') {
-                    if ($version =~ /(dfsg|debian|ds)/) {
+                    if ($info->is_repacked_tarball) {
                         tag 'debian-rules-missing-good-practice-target-dfsg',
                           $target;
                     }
diff --git a/debian/changelog b/debian/changelog
index a5cbe4e..69f3de2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -142,6 +142,8 @@ lintian (2.5.53) UNRELEASED; urgency=medium
   * lib/Lintian/Check.pm:
     + [CL] Stop emitting {maintainer,uploader}-address-causes-mail-loops
       for @packages.debian.org addresses.  (Closes: #871575)
+  * lib/Lintian/Collect/Source.pm:
+    + [CL] Add $info->is_repacked_tarball utility.  (Refs: #871957)
   * lib/Lintian/Data.pm:
     + [CL] Modify Lintian::Data's "all" to always return keys in insertion
       order, dropping dependency on libtie-ixhash-perl.
diff --git a/lib/Lintian/Collect/Source.pm b/lib/Lintian/Collect/Source.pm
index 518eae2..93f6078 100644
--- a/lib/Lintian/Collect/Source.pm
+++ b/lib/Lintian/Collect/Source.pm
@@ -678,6 +678,25 @@ sub is_non_free {
     return $self->{is_non_free};
 }
 
+=item is_repacked_tarball
+
+Returns a truth value if the package appears to be a repacked tarball.
+
+Needs-Info requirements for using I<native>: L<Same as field|Lintian::Collect/field ([FIELD[, DEFAULT]])>
+
+=cut
+
+sub is_repacked_tarball {
+    my ($self) = @_;
+    return $self->{is_repacked_tarball} if exists $self->{is_repacked_tarball};
+    $self->{is_repacked_tarball} = 0;
+    my $version = $self->field('version', '0-1');
+    if ($version =~ /(dfsg|debian|ds|repack)/) {
+        $self->{is_repacked_tarball} = 1;
+    }
+    return $self->{is_repacked_tarball};
+}
+
 =back
 
 =head1 AUTHOR

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


Reply to: