summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Peter <megastep@megastep.org>2021-04-29 17:50:59 -0700
committerStephane Peter <megastep@megastep.org>2021-04-29 17:50:59 -0700
commitf8bd014082fb23b671e0a9cc27b0b40d3fb7f395 (patch)
treeaf850d599e67d80cce861dc31ef36a3a2e7ee9b6
parent114f4cbc5c47074ade4ad3ecd32cd71783e78d4b (diff)
downloadmakeself-f8bd014082fb23b671e0a9cc27b0b40d3fb7f395.tar.gz
Try to use GNU tar if available; switch to pax
-rwxr-xr-xmakeself.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/makeself.sh b/makeself.sh
index 6224cf5..64047ab 100755
--- a/makeself.sh
+++ b/makeself.sh
@@ -639,6 +639,10 @@ if test "$QUIET" = "n"; then
echo "Adding files to archive named \"$archname\"..."
fi
+# See if we have GNU tar
+TAR=`exec <&- 2>&-; which gtar || command -v gtar || type gtar`
+test -x "$TAR" || TAR=tar
+
tmparch="${TMPDIR:-/tmp}/mkself$$.tar"
(
if test "$APPEND" = "y"; then
@@ -664,7 +668,7 @@ tmparch="${TMPDIR:-/tmp}/mkself$$.tar"
\) -print \
| LC_ALL=C sort \
| sed 's/./\\&/g' \
- | xargs tar $TAR_EXTRA --format v7 -$TAR_ARGS "$tmparch"
+ | xargs $TAR $TAR_EXTRA --format pax -$TAR_ARGS "$tmparch"
) || {
echo "ERROR: failed to create temporary archive: $tmparch"
rm -f "$tmparch" "$tmpfile"