diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2016-02-04 13:00:00 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2016-02-04 13:00:00 -0800 |
commit | 14085b1c9b314b2034ca70bb6eefb47f79d9b1d5 (patch) | |
tree | a07a8ccb8ffec9b59b0d8da4e1a2ef56e0baf87a /snapshots-create.sh | |
parent | thicken-manifests: Fixup pylint. (diff) | |
download | mastermirror-scripts-14085b1c9b314b2034ca70bb6eefb47f79d9b1d5.tar.gz mastermirror-scripts-14085b1c9b314b2034ca70bb6eefb47f79d9b1d5.tar.bz2 mastermirror-scripts-14085b1c9b314b2034ca70bb6eefb47f79d9b1d5.zip |
snapshots-create: pixz causes SIGPIPE issues, try threaded xz instead.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'snapshots-create.sh')
-rwxr-xr-x | snapshots-create.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh index 600b9c3..a327522 100755 --- a/snapshots-create.sh +++ b/snapshots-create.sh @@ -50,6 +50,7 @@ if [[ ! -e "${UPLOAD}/${DELTA_FILENAME}" ]]; then fi # Find fastest BZIP2 +# lbzip2,pbzip2 default to multiple threads for BZIP2_PROG in lbzip2 pbzip2 bzip2 FAIL ; do [ -n "$(type $BZIP2_PROG 2>/dev/null)" ] && break done @@ -58,13 +59,18 @@ if [ $BZIP2_PROG == FAIL ]; then exit 1 fi # Find fastest XZ -for XZ_PROG in pixz xz FAIL ; do +# pixz appends some data and leads to SIGPIPE +for XZ_PROG in xz FAIL ; do [ -n "$(type $XZ_PROG 2>/dev/null)" ] && break done if [ $XZ_PROG == FAIL ]; then echo "Could not find any xz" 1>&2 exit 1 fi +# Newer 'xz' supports threads as well, but defaults to single-threaded +if $XZ_PROG --help |grep -sq threads=NUM ; then + XZ_PROG="${XZ_PROG} -T 0" +fi # working dir cd ${TEMP} |