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 <zbehan@chromium.org>
Tested-by: David James <davidjames@chromium.org>
This commit is contained in:
David James 2011-08-06 16:49:57 -07:00
parent 46657a3d09
commit 27064994fa
2 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -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