Rebuild host workon packages if they are changed.

Previously, if you were working on a cros_workon package on the host, it
would only get updated once -- after that, the package would never build
again.

With this change, we now rebuild host workon packages any time their
timestamp is modified. This replicates the same feature that we already
have for board packages.

BUG=chromium-os:12771
TEST=Verify that host workon packages are rebuilt when the timestamps change,
     and only when the timestamps change.

Change-Id: I31ef1d83dc591161a7cb55c4af806ee4a4212cdd
Reviewed-on: https://gerrit.chromium.org/gerrit/24782
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
This commit is contained in:
David James 2012-06-07 14:55:46 -07:00 committed by Gerrit
parent 4c29c24c77
commit 85dd140217

View File

@ -76,8 +76,9 @@ fi
# Perform an update of hard-host-depends and world in the chroot.
EMERGE_CMD="emerge"
CHROMITE_BIN="${GCLIENT_ROOT}/chromite/bin"
if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then
EMERGE_CMD="${GCLIENT_ROOT}/chromite/bin/parallel_emerge"
EMERGE_CMD="${CHROMITE_BIN}/parallel_emerge"
fi
# In first pass, update portage and toolchains. Lagged updates of both
@ -95,6 +96,11 @@ if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_FALSE}" ]; then
sudo $(type -p cros_setup_toolchains) ${TOOLCHAIN_FLAGS}
fi
# Build cros_workon packages when they are changed.
for pkg in $("${CHROMITE_BIN}/cros_list_modified_packages" --host); do
EMERGE_FLAGS+=" --reinstall-atoms=${pkg} --usepkg-exclude=${pkg}"
done
# Second pass, update everything else.
EMERGE_FLAGS+=" --deep"
sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} \