From 27064994fae127f83ae1fce3705c5b95d1808171 Mon Sep 17 00:00:00 2001 From: David James Date: Sat, 6 Aug 2011 16:49:57 -0700 Subject: [PATCH] Use pbzip2 in archive_build, if it is available. BUG=chromium-os:16502 TEST=Run cbuildbot run of archive stage with official build. Change-Id: I03898404dd27d6930c4a01bd9826796ddb07a4cd Reviewed-on: http://gerrit.chromium.org/gerrit/5445 Reviewed-by: Zdenek Behan Tested-by: David James --- archive_build.sh | 7 ++++++- archive_hwqual | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/archive_build.sh b/archive_build.sh index e04f915f1a..9e1b0bec82 100755 --- a/archive_build.sh +++ b/archive_build.sh @@ -161,7 +161,12 @@ if [ $FLAGS_test_mod -eq $FLAGS_TRUE ]; then pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" echo "Archiving autotest build artifacts" - tar cjf "${FLAGS_from}/autotest.tar.bz2" --checkpoint=1000 autotest + if which pbzip2 >/dev/null 2>/dev/null; then + TAR_BZIP2="tar --use-compress-program=pbzip2" + else + TAR_BZIP2="tar --bzip2" + fi + ${TAR_BZIP2} -cf "${FLAGS_from}/autotest.tar.bz2" --checkpoint=10000 autotest popd fi diff --git a/archive_hwqual b/archive_hwqual index 27d1b38046..6fa7498342 100755 --- a/archive_hwqual +++ b/archive_hwqual @@ -72,8 +72,14 @@ function main() { mkdir -p image mkdir -p "tarball/${FLAGS_output_tag}" + if which pbzip2 >/dev/null 2>/dev/null; then + TAR_BZIP2="tar --use-compress-program=pbzip2" + else + TAR_BZIP2="tar --bzip2" + fi + echo "Extracting autotest from build artifacts..." - tar --bzip2 -xf autotest.tar.bz2 + ${TAR_BZIP2} -xf autotest.tar.bz2 cd "${TMP}" @@ -104,7 +110,7 @@ function main() { echo "Creating ${FLAGS_to}/${FLAGS_output_tag}.tar.bz2..." mkdir -p "${FLAGS_to}" cd tarball - tar --bzip2 -cf "${FLAGS_to}/${FLAGS_output_tag}.tar.bz2" . + ${TAR_BZIP2} -cf "${FLAGS_to}/${FLAGS_output_tag}.tar.bz2" . trap - EXIT cleanup