diff options
author | Stephen Hines <srhines@google.com> | 2017-02-08 10:40:03 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-02-08 10:40:03 +0000 |
commit | 9c6fa5f9e514c743e62be0ee401c12e10c94d7f1 (patch) | |
tree | 87b3a32b13c392939d66fa93105896f5df0736a6 /binary_search_tool/cros_pkg/switch_to_bad.sh | |
parent | baba90fd78c18585d22430dc95c748f96ad0c772 (diff) | |
parent | 870a8df6fcb12de32fa2dd83b6ed0f7b24dbab1e (diff) | |
download | toolchain-utils-9c6fa5f9e514c743e62be0ee401c12e10c94d7f1.tar.gz |
Merge remote-tracking branch 'aosp/mirror-chromium-master' into initial_import
am: 870a8df6fc
Change-Id: I98e43c690589937e0db0981fc88383583c7b36d3
Diffstat (limited to 'binary_search_tool/cros_pkg/switch_to_bad.sh')
-rwxr-xr-x | binary_search_tool/cros_pkg/switch_to_bad.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/binary_search_tool/cros_pkg/switch_to_bad.sh b/binary_search_tool/cros_pkg/switch_to_bad.sh new file mode 100755 index 00000000..126425f4 --- /dev/null +++ b/binary_search_tool/cros_pkg/switch_to_bad.sh @@ -0,0 +1,46 @@ +#!/bin/bash -u +# +# Copyright 2015 Google Inc. All Rights Reserved. +# +# This script is intended to be used by binary_search_state.py, as +# part of the binary search triage on ChromeOS packages. This script +# copies a list of packages from the 'bad' build tree into the working +# build tree, for testing. +# + +source common/common.sh + +pushd ${WORK_BUILD} + +PKG_LIST_FILE=$1 + +overall_status=0 + +if [[ -f ${PKG_LIST_FILE} ]] ; then + + # Read every line, and handle case where last line has no newline + while read pkg || [[ -n "$pkg" ]]; + do + sudo cp ${BAD_BUILD}/packages/$pkg ${WORK_BUILD}/packages/$pkg + status=$? + if [[ ${status} -ne 0 ]] ; then + echo "Failed to copy ${pkg} to work build tree." + overall_status=2 + fi + done < ${PKG_LIST_FILE} +else + + for o in "$@" + do + sudo cp ${BAD_BUILD}/packages/$o ${WORK_BUILD}/packages/$o + status=$? + if [[ ${status} -ne 0 ]] ; then + echo "Failed to copy ${pkg} to work build tree." + overall_status=2 + fi + done +fi + +popd + +exit ${overall_status} |