commit: e5bb6756c125c1b2d70e63aa90b0d1485300f062
parent 01b862af3be3cde43223e4b900f0025f70aaaac2
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 13 Nov 2018 15:06:05 -0800
Allow overriding pax command with PAXREAD
Most systems do not have pax installed by default, or it is not available
at all. However, since we are relying on the -s flag for member name
substitution, we can't just use a tar command that works everywhere.
Instead, support the environment variable PAXREAD to specify the command
to use in place of `pax -r`. Since bsdtar from libarchive supports -s,
we can set PAXREAD='bsdtar -xf -'.
Diffstat:
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pkg/git/fetch.sh b/pkg/git/fetch.sh
@@ -15,4 +15,4 @@ if ! sha256sum -c sha256 2>/dev/null ; then
fi
read -r checksum archive <sha256
-xzcat "$archive" | pax -r -s ',^\.,src/man,'
+xzcat "$archive" | ${PAXREAD:-pax -r} -s ',^\.,src/man,'
diff --git a/pkg/openbsd/fetch.sh b/pkg/openbsd/fetch.sh
@@ -14,7 +14,7 @@ if ! sha256sum -c sha256 2>/dev/null ; then
sha256sum -c sha256
fi
-zcat src.tar.gz | pax -r -s '/^/src\//' \
+zcat src.tar.gz | ${PAXREAD:-pax -r} -s ',^,src/,' \
'bin/pax/*' \
'include/*' \
'lib/libc/*' \
@@ -27,6 +27,6 @@ zcat src.tar.gz | pax -r -s '/^/src\//' \
'usr.bin/nc/*' \
'usr.bin/patch/*' \
'usr.bin/yacc/*'
-zcat sys.tar.gz | pax -r -s '/^/src\//' 'sys/sys/*'
+zcat sys.tar.gz | ${PAXREAD:-pax -r} -s ',^,src/,' 'sys/sys/*'
git apply -v --whitespace=nowarn --directory "$dir/src" patch/*
diff --git a/scripts/fetch-curl.sh b/scripts/fetch-curl.sh
@@ -31,7 +31,7 @@ while read -r checksum archive ; do
tool=
esac
if [ -n "$tool" ] ; then
- "$tool" "$archive" | pax -r -s '/^\.\|[^\/]*/src/' '*/*'
+ "$tool" "$archive" | ${PAXREAD:-pax -r} -s ',^[^/]*,src,' '*/*'
fi
done <sha256