mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
make_tarball: search for a tar that supports the options we need
This commit is contained in:
parent
79fa4d5c4a
commit
b883e59ee9
1 changed files with 16 additions and 1 deletions
|
@ -14,6 +14,21 @@ set -e
|
||||||
# but to get the documentation in, we need to make a symlink called "fish-VERSION"
|
# but to get the documentation in, we need to make a symlink called "fish-VERSION"
|
||||||
# and tar from that, so that the documentation gets the right prefix
|
# and tar from that, so that the documentation gets the right prefix
|
||||||
|
|
||||||
|
# We need GNU tar as that supports the --mtime option
|
||||||
|
# BSD tar supports --mtree but keeping them in sync sounds too hard
|
||||||
|
TAR=notfound
|
||||||
|
for try in tar gtar gnutar; do
|
||||||
|
if $try -Pcf /dev/null --mtime now /dev/null >/dev/null 2>&1; then
|
||||||
|
TAR=$try
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$TAR" = "notfound" ]; then
|
||||||
|
echo 'No suitable tar (supporting --mtime) found as tar/gtar/gnutar in PATH'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Get the current directory, which we'll use for symlinks
|
# Get the current directory, which we'll use for symlinks
|
||||||
wd="$PWD"
|
wd="$PWD"
|
||||||
|
|
||||||
|
@ -43,7 +58,7 @@ echo $VERSION > version
|
||||||
cd /tmp
|
cd /tmp
|
||||||
rm -f "$prefix"
|
rm -f "$prefix"
|
||||||
ln -s "$wd" "$prefix"
|
ln -s "$wd" "$prefix"
|
||||||
TAR_APPEND="gnutar --append --file=$path --mtime=now --owner=0 --group=0 --mode=g+w,a+rX"
|
TAR_APPEND="$TAR --append --file=$path --mtime=now --owner=0 --group=0 --mode=g+w,a+rX"
|
||||||
$TAR_APPEND --no-recursion "$prefix"/user_doc
|
$TAR_APPEND --no-recursion "$prefix"/user_doc
|
||||||
$TAR_APPEND "$prefix"/user_doc/html "$prefix"/share/man
|
$TAR_APPEND "$prefix"/user_doc/html "$prefix"/share/man
|
||||||
$TAR_APPEND "$prefix"/version
|
$TAR_APPEND "$prefix"/version
|
||||||
|
|
Loading…
Reference in a new issue