From 4ca5109536f379359778a45655718dc6948ed2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Thu, 23 Jun 2016 12:41:38 +0000 Subject: 999.tarballs.build: compress w/ multiple threads via pbzip2, pigz, or xz -T0, respectively. --- 999.tarballs.build | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/999.tarballs.build b/999.tarballs.build index a25a4c28..7ff794a7 100644 --- a/999.tarballs.build +++ b/999.tarballs.build @@ -10,11 +10,20 @@ else update_build_status build_finish tarball_start; cd ${PREFIX}; if [ "${TARBALL_SUFFIX}" = "bz2" ]; then - TARBALL_COMPRESS_CMD="bzip2"; + if [ -n "$(which pbzip2 2>/dev/null)" ]; then + TARBALL_COMPRESS_CMD="pbzip2"; + else + TARBALL_COMPRESS_CMD="bzip2"; + fi; elif [ "${TARBALL_SUFFIX}" = "gz" ]; then - TARBALL_COMPRESS_CMD="gzip"; + if [ -n "$(which pigz 2>/dev/null)" ]; then + TARBALL_COMPRESS_CMD="pigz"; + else + TARBALL_COMPRESS_CMD="gzip"; + fi; elif [ "${TARBALL_SUFFIX}" = "xz" ]; then TARBALL_COMPRESS_CMD="xz"; + TARBALL_COMPRESS_ARGS="-T0"; else log_msg failexit "Unknown tarball suffix \`.${TARBALL_SUFFIX}'."; fi; @@ -35,7 +44,7 @@ log_msg info "Converted symbolic links in ${PREFIX_BASENAME}/lib to hard links." tar -cpf - $(find_with_no_paths "${TARBALL_EXCLUDE_PATHS} native/lib.bak" . \ -mindepth 1 -maxdepth 2 -type d -not -path ./native) \ "Create \`Midipix mintty shell' shortcut.vbs" midipix.sh README |\ -${TARBALL_COMPRESS_CMD} -c > ${TARBALL_FNAME}; +${TARBALL_COMPRESS_CMD} ${TARBALL_COMPRESS_ARGS} -c > ${TARBALL_FNAME}; log_msg info "Finished building binary distribution tarball."; if [ -x "$(which gpg 2>/dev/null)" -a -n "${TARBALL_SIGN_GPG_KEY}" ] &&\ gpg --list-keys "${TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then @@ -49,7 +58,7 @@ log_msg info "Restored ${PREFIX_BASENAME}/lib."; log_msg info "Building source tarball..."; tar -cpf - $(find tmp -mindepth 1 -maxdepth 1 -type d) |\ -${TARBALL_COMPRESS_CMD} -c > ${TARBALL_SRC_FNAME}; +${TARBALL_COMPRESS_CMD} ${TARBALL_COMPRESS_ARGS} -c > ${TARBALL_SRC_FNAME}; log_msg info "Finished building source tarball."; if [ -x "$(which gpg 2>/dev/null)" -a -n "${TARBALL_SRC_SIGN_GPG_KEY}" ] &&\ gpg --list-keys "${TARBALL_SRC_SIGN_GPG_KEY}" >/dev/null 2>&1; then -- cgit v1.2.3