Fix --jobs flags to actually work.
The --jobs=<n> option wasn't actually being passed to parallel_emerge --
which meant it didn't do anything.
BUG=chromium-os:26827
TEST=Ran with --jobs=N and made sure only N parallel_emerge processes were
started.
Change-Id: I581fc5588b54e246acaefd0c7e528e55adf9ba8a
Reviewed-on: https://gerrit.chromium.org/gerrit/16570
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh
index 64d4334..012cbb0 100755
--- a/sdk_lib/make_chroot.sh
+++ b/sdk_lib/make_chroot.sh
@@ -216,10 +216,6 @@
sudo ln -s ../../cache/distfiles/target \
"${FLAGS_chroot}/var/lib/portage/distfiles-target"
- if [[ $FLAGS_jobs -ne -1 ]]; then
- EMERGE_JOBS="--jobs=$FLAGS_jobs"
- fi
-
# Add chromite/bin and depot_tools into the path globally; note that the
# chromite wrapper itself might also be found in depot_tools.
# We rely on 'env-update' getting called below.
@@ -464,6 +460,9 @@
else
UPDATE_ARGS+=( --nofast )
fi
+if [[ "${FLAGS_jobs}" -ne -1 ]]; then
+ UPDATE_ARGS+=( --jobs=${FLAGS_jobs} )
+fi
enter_chroot "${CHROOT_TRUNK}/src/scripts/update_chroot" "${UPDATE_ARGS[@]}"
CHROOT_EXAMPLE_OPT=""