Skip to content

Commit

Permalink
Item13929: Handling of both FreeBSD and MacOS styles of GNU tar naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Nov 11, 2016
1 parent 5adc0a8 commit f525988
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions core/lib/Foswiki/Configure/FileUtil.pm
Expand Up @@ -712,14 +712,19 @@ sub _getTar {

# Trying to find gnutar in order to keep as much compatibility with
# linux as we can.
my $gnutar = `which gnutar`;
if ( $? == 0 && $gnutar ) {
chomp $gnutar;
if ( _getTarFamily($gnutar) eq 'gnu' ) {
$tarCmd = $gnutar;
$tarFamily = 'gnu';
}
my $gnutar;
TAR_UTIL:
foreach my $utilname (qw(gtar gnutar)) {
$gnutar = `which $utilname`;
if ( $? == 0 && $gnutar ) {
chomp $gnutar;
if ( _getTarFamily($gnutar) eq 'gnu' ) {
$tarCmd = $gnutar;
$tarFamily = 'gnu';
last TAR_UTIL;
}

}
}

}
Expand Down

0 comments on commit f525988

Please sign in to comment.