summaryrefslogtreecommitdiff
path: root/tests/archive.pl
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-10 22:26:57 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-10 22:26:57 -0700
commite90d2ac8ba44fbcf4d5702643f708f2c86bde42e (patch)
treea52fe8e4efee8176da169998c203c1a93f6a6ff1 /tests/archive.pl
parent6457f0941204a79ec5ba359a12aa00bf06f0e621 (diff)
parent405fefc8777c55900a4e44561b545a9abb5276ba (diff)
Merge branch 'master' into compact
Diffstat (limited to 'tests/archive.pl')
-rw-r--r--tests/archive.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/archive.pl b/tests/archive.pl
index 0a03b23..76484f7 100644
--- a/tests/archive.pl
+++ b/tests/archive.pl
@@ -2,11 +2,12 @@
use Archive::Tar;
use Archive::Zip;
+use File::Basename;
my $target = shift @ARGV;
my @sources = @ARGV;
-my $basedir = ($target =~ /^(.*)(\.zip|\.tar.gz|\.tgz)$/) ? "$1/" : '';
+my $basedir = basename($target, ('.zip', '.tar.gz', '.tgz')) . '/';
my $zip = $target =~ /\.zip$/;
my $arch = $zip ? Archive::Zip->new : Archive::Tar->new;