Permalink
Browse files

Item13929: Handling of both FreeBSD and MacOS styles of GNU tar naming.

  • Loading branch information...
1 parent 5adc0a8 commit f5259881391f69b3156705fdf5900c6d70f3ed05 @vrurg vrurg committed Nov 11, 2016
Showing with 12 additions and 7 deletions.
  1. +12 −7 core/lib/Foswiki/Configure/FileUtil.pm
@@ -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;
+ }
+ }
}
}

0 comments on commit f525988

Please sign in to comment.