Skip to content

Commit

Permalink
Merge pull request #839 from gugod/cygwin-tar-command
Browse files Browse the repository at this point in the history
On cygwin, require `--force-local -` parameter to `tar`.
  • Loading branch information
gugod authored Feb 8, 2025
2 parents a2081a1 + 1cb53ad commit 9e1e244
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions lib/App/perlbrew.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1159,14 +1159,29 @@ sub do_extract_tarball {
$workdir->mkpath;
my $extracted_dir;
# Was broken on Solaris, where GNU tar is probably
# installed as 'gtar' - RT #61042
my $tarx = ( $^O =~ /solaris|aix/ ? 'gtar ' : 'tar ' )
. (
$dist_tarball =~ m/xz$/ ? 'xJf'
: $dist_tarball =~ m/bz2$/ ? 'xjf'
: 'xzf'
);
my $tarx = do {
if ($^O eq 'cygwin') {
# https://github.com/gugod/App-perlbrew/issues/832
# https://github.com/gugod/App-perlbrew/issues/833
'tar --force-local -'
} elsif ($^O =~ /solaris|aix/) {
# On Solaris, GNU tar is installed as 'gtar' - RT #61042
# https://rt.cpan.org/Ticket/Display.html?id=61042
'gtar '
} else {
'tar '
}
};
$tarx .= do {
if ($dist_tarball =~ m/xz$/) {
'xJf'
} elsif ($dist_tarball =~ m/bz2$/) {
'xjf'
} else {
'xzf'
}
};
my $extract_command = "cd $workdir; $tarx $dist_tarball";
die "Failed to extract $dist_tarball" if system($extract_command);
Expand Down

0 comments on commit 9e1e244

Please sign in to comment.