Use --fast by default in build_image when --jobs is enabled.

Also update eretry to not pass in $EMERGE_JOBS anymore, in coordination with my previous change, which passed it in directly instead of depending on eretry to do so: http://codereview.chromium.org/2944004/show

TEST=Ran build_image --jobs 2 and build_packages --jobs 2
BUG=none

Review URL: http://codereview.chromium.org/2914004
This commit is contained in:
David James 2010-07-08 20:17:45 -07:00
parent 9b20ce4cb0
commit f0fb864e8d
2 changed files with 7 additions and 7 deletions

View File

@ -92,6 +92,11 @@ if [ "${FLAGS_rootfs_size}" -gt "${FLAGS_rootfs_partition_size}" ] ; then
exit 1
fi
if [ ${FLAGS_jobs} -ne -1 ]; then
EMERGE_JOBS="--jobs=${FLAGS_jobs}"
FLAGS_fast=${FLAGS_TRUE}
fi
EMERGE_BOARD_CMD="emerge-${FLAGS_board}"
if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then
echo "Using alternate emerge"
@ -161,10 +166,6 @@ if [[ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]] ; then
INSTALL_MASK="${INSTALL_MASK} ${FACTORY_INSTALL_MASK}"
fi
if [[ ${FLAGS_jobs} -ne -1 ]]; then
EMERGE_JOBS="--jobs=${FLAGS_jobs}"
fi
# Figure out ARCH from the given toolchain.
# TODO: Move to common.sh as a function after scripts are switched over.
TC_ARCH=$(echo "${CHOST}" | awk -F'-' '{ print $1 }')

View File

@ -325,14 +325,13 @@ function die {
}
# Retry an emerge command according to $FLAGS_retries
# The $EMERGE_JOBS flags will only be added the first time the command is run
function eretry () {
$* && return 0
local i=
for i in $(seq $FLAGS_retries); do
echo Retrying $*
$* $EMERGE_JOBS && return 0
$* && return 0
done
$* && return 0
return 1
}