[dh-make-perl] 04/05: Iterate over all supported tar ball suffixes in guess_tarball()

Axel Beckert abe at deuxchevaux.org
Sun Jan 19 16:37:28 UTC 2014


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

abe pushed a commit to branch master
in repository dh-make-perl.

commit 0c0929a2b74a2de32e152367fbe4406ae8632514
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Sun Jan 19 16:08:44 2014 +0100

    Iterate over all supported tar ball suffixes in guess_tarball()
---
 debian/changelog               |  1 +
 lib/DhMakePerl/Command/make.pm | 20 +++++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 287d9d2..000ae01 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,6 +35,7 @@ dh-make-perl (0.81-1) UNRELEASED; urgency=medium
   * Code-deduplication by splitting up guess_tarball() into
     guess_tarball($prefix) and guess_debian_tarball() and then using
     guess_tarball() also in setup_dir().
+  * Iterate over all supported tar ball suffixes in guess_tarball().
 
  -- Dima Kogan <dima at secretsauce.net>  Wed, 25 Dec 2013 17:08:35 +0100
 
diff --git a/lib/DhMakePerl/Command/make.pm b/lib/DhMakePerl/Command/make.pm
index 5e9b9b4..ff73669 100644
--- a/lib/DhMakePerl/Command/make.pm
+++ b/lib/DhMakePerl/Command/make.pm
@@ -271,17 +271,19 @@ sub guess_tarball {
     die "guess_tarball(): Needs everything except the file type suffix as parameter"
         unless defined $prefix;
 
-    my $try = "$prefix.tar.gz";
+    foreach my $compression_suffix (qw(gz bz2 xz lzma)) {
+        my $try = "$prefix.tar.$compression_suffix";
 
-    print "Trying $try...";
-    if ( -f $try ) {
-        print " found!\n";
-        return $try;
-    }
-    else {
-        print " not found.\n";
-        return undef;
+        print "Trying $try...";
+        if ( -f $try ) {
+            print " found!\n";
+            return $try;
+        }
+        else {
+            print " not found.\n";
+        }
     }
+    return undef;
 }
 
 sub setup_dir {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/dh-make-perl.git



More information about the Pkg-perl-cvs-commits mailing list