From b44b04d0f951f4af00646f39ca90456aca51affa Mon Sep 17 00:00:00 2001 From: David James Date: Tue, 20 Jul 2010 00:36:32 -0700 Subject: [PATCH] Update mod_image_for_test to support --fast option. Added --fast option. Updated the one place that wasn't using sudo when calling emerge to use sudo like the others. This is safe because we're merging with --usepkgonly. TEST=Ran mod_image_for_test.sh with and without the --fast options BUG=none Review URL: http://codereview.chromium.org/2834055 --- mod_image_for_test.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mod_image_for_test.sh b/mod_image_for_test.sh index dba4b84d03..ea14659aa8 100755 --- a/mod_image_for_test.sh +++ b/mod_image_for_test.sh @@ -32,6 +32,7 @@ DEFINE_string qualdb "" "Location of qualified component file" d DEFINE_boolean yes $FLAGS_FALSE "Answer yes to all prompts" y DEFINE_string build_root "/build" \ "The root location for board sysroots." +DEFINE_boolean fast ${FLAGS_FALSE} "Call many emerges in parallel" # Parse command line @@ -40,9 +41,10 @@ eval set -- "${FLAGS_ARGV}" EMERGE_CMD="emerge" EMERGE_BOARD_CMD="emerge-${FLAGS_board}" -TOP_SCRIPTS_DIR="$(dirname $0)" -if [ -e "${TOP_SCRIPTS_DIR}/.emerge" ]; then - . "${TOP_SCRIPTS_DIR}/.emerge" +if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then + echo "Using alternate emerge" + EMERGE_CMD="${SCRIPTS_DIR}/parallel_emerge" + EMERGE_BOARD_CMD="${EMERGE_CMD} --board=${FLAGS_board}" fi # No board, no default and no image set then we can't find the image @@ -95,7 +97,7 @@ emerge_chromeos_test() { # Determine the root dir for test packages. ROOT_DEV_DIR="$ROOT_FS_DIR/usr/local" - INSTALL_MASK="$INSTALL_MASK" $EMERGE_BOARD_CMD \ + sudo INSTALL_MASK="$INSTALL_MASK" $EMERGE_BOARD_CMD \ --root="$ROOT_DEV_DIR" --root-deps=rdeps \ --usepkgonly chromeos-test $EMERGE_JOBS }