Skip to content

Commit

Permalink
make unpkg handle .xz files
Browse files Browse the repository at this point in the history
  • Loading branch information
dbushong committed Feb 29, 2016
1 parent 213b69f commit c510197
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin-shared/unpkg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ for my $pkg (@ARGV) {
my $file = basename($pkg);
my $rm = ($file !~ /\.part$/);
my $base = $file;
$base=~ s/\.(zip|xpi|crx|jar|7z|tar(\.(gz|bz2))?|t[bg]z|rar|cbr)(\.part)?$//i;
$base=~ s/\.(zip|xpi|crx|jar|7z|tar(\.(gz|bz2|xz))?|t[bg]z|rar|cbr)(\.part)?$//i;
if ($file eq $base) { # no extension(s) removed
my $infer = `file \Q$pkg\E 2>&1`;
# TODO: add more
Expand Down Expand Up @@ -71,6 +71,9 @@ for my $pkg (@ARGV) {
elsif ($file =~ /\.(tbz|tar\.bz2)(\.part)?$/i) {
$fail = system('tar', 'jxf', $pkg);
}
elsif ($file =~ /\.(txz|tar\.xz)(\.part)?$/i) {
$fail = system('tar', 'Jxf', $pkg);
}
elsif ($file =~ /\.tar$/i) {
$fail = system('tar', 'xf', $pkg);
}
Expand Down

0 comments on commit c510197

Please sign in to comment.