Tools: Compress our tarball using threads.

Check to see if xz supports threads and enable them if that's the case.

Change-Id: I8a0e7100fec98e5b7d7ccd9a987f7782bf7c7512
Reviewed-on: https://code.wireshark.org/review/30137
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Gerald Combs 2018-10-11 15:08:23 -07:00 committed by Anders Broman
parent 659966d29b
commit c5d46c1986
1 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,7 @@ fi
DESCRIPTION=$(git describe --abbrev=8 --match "v[1-9]*" "${COMMIT}")
VERSION=${DESCRIPTION#v}
STASH_POP=False
XZ_OPTS=
# We might be able to avoid stashing by doing one of the following:
#
@ -75,7 +76,9 @@ fi
echo "Creating wireshark-$VERSION.tar.xz"
git archive --prefix="wireshark-${VERSION}/" ${COMMIT} | xz > "${DESTDIR}/wireshark-${VERSION}.tar.xz"
echo . | xz --threads=0 > /dev/null 2>&1 && XZ_OPTS=--threads=0
git archive --prefix="wireshark-${VERSION}/" ${COMMIT} | xz $XZ_OPTS > "${DESTDIR}/wireshark-${VERSION}.tar.xz"
if [ "$STASH_POP" == "True" ] ; then
git stash pop