diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-04-10 20:38:47 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-04-10 20:45:07 -0700 |
commit | f1d15342102f7cb9741489901787148fd62844d0 (patch) | |
tree | b668e93544455c5e40ad35f2ba1f415bb65e24f8 /tests/archive.pl | |
parent | 10ff488eb96544074c88ba1aae26025b425dba58 (diff) |
Fix archive packaging
Base directory is now using target basename.
Diffstat (limited to 'tests/archive.pl')
-rw-r--r-- | tests/archive.pl | 3 |
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; |