summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-10 20:38:47 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-10 20:45:07 -0700
commitf1d15342102f7cb9741489901787148fd62844d0 (patch)
treeb668e93544455c5e40ad35f2ba1f415bb65e24f8 /tests
parent10ff488eb96544074c88ba1aae26025b425dba58 (diff)
Fix archive packaging
Base directory is now using target basename.
Diffstat (limited to 'tests')
-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;