mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-11 15:06:58 +02:00
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
This commit is contained in:
parent
21fd22e1b1
commit
b44b04d0f9
@ -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_boolean yes $FLAGS_FALSE "Answer yes to all prompts" y
|
||||||
DEFINE_string build_root "/build" \
|
DEFINE_string build_root "/build" \
|
||||||
"The root location for board sysroots."
|
"The root location for board sysroots."
|
||||||
|
DEFINE_boolean fast ${FLAGS_FALSE} "Call many emerges in parallel"
|
||||||
|
|
||||||
|
|
||||||
# Parse command line
|
# Parse command line
|
||||||
@ -40,9 +41,10 @@ eval set -- "${FLAGS_ARGV}"
|
|||||||
|
|
||||||
EMERGE_CMD="emerge"
|
EMERGE_CMD="emerge"
|
||||||
EMERGE_BOARD_CMD="emerge-${FLAGS_board}"
|
EMERGE_BOARD_CMD="emerge-${FLAGS_board}"
|
||||||
TOP_SCRIPTS_DIR="$(dirname $0)"
|
if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
if [ -e "${TOP_SCRIPTS_DIR}/.emerge" ]; then
|
echo "Using alternate emerge"
|
||||||
. "${TOP_SCRIPTS_DIR}/.emerge"
|
EMERGE_CMD="${SCRIPTS_DIR}/parallel_emerge"
|
||||||
|
EMERGE_BOARD_CMD="${EMERGE_CMD} --board=${FLAGS_board}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# No board, no default and no image set then we can't find the image
|
# 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.
|
# Determine the root dir for test packages.
|
||||||
ROOT_DEV_DIR="$ROOT_FS_DIR/usr/local"
|
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 \
|
--root="$ROOT_DEV_DIR" --root-deps=rdeps \
|
||||||
--usepkgonly chromeos-test $EMERGE_JOBS
|
--usepkgonly chromeos-test $EMERGE_JOBS
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user