aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2016-01-28 11:09:00 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2016-01-28 11:09:00 -0800
commitd4c0a6684207b099316e1b5478b2369c7dc01011 (patch)
tree85599e53ac0d9e6f8392f1c1dd04d3039810c6d7 /snapshots-create.sh
parentsnapshots-create: Hide an error that we do not care about (diff)
downloadmastermirror-scripts-d4c0a6684207b099316e1b5478b2369c7dc01011.tar.gz
mastermirror-scripts-d4c0a6684207b099316e1b5478b2369c7dc01011.tar.bz2
mastermirror-scripts-d4c0a6684207b099316e1b5478b2369c7dc01011.zip
Use parallel XZ as well.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'snapshots-create.sh')
-rwxr-xr-xsnapshots-create.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh
index 15795be..e2c5e2d 100755
--- a/snapshots-create.sh
+++ b/snapshots-create.sh
@@ -57,6 +57,14 @@ if [ $BZIP2_PROG == FAIL ]; then
echo "Could not find any BZIP2" 1>&2
exit 1
fi
+# Find fastest XZ
+for XZ_PROG in pixz 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
# working dir
cd ${TEMP}
@@ -105,7 +113,7 @@ write_time_log "END SIZE SANITY $(date -u)"
# 3) create xz tarball
write_time_log "START XZ $(date -u)"
if [ ! -f "${FILENAME%.*}.xz" ] ; then
- xz -k -9 -e "${FILENAME%.*}" || exit $?
+ ${XZ_PROG} -k -9 -e "${FILENAME%.*}" || exit $?
fi
write_time_log "END XZ $(date -u)"
# end 3)