From 20325a547f3d103929b5b060ea4b046ff0522883 Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Wed, 1 Mar 2017 10:52:17 -0800 Subject: [PATCH] build_image_util: allow unchecked emerges too This is useful for emerges that are meant for incomplete rootfs's, such as ACI building emerges. There are cases where the #! check is expected to fail while doing those. --- build_library/build_image_util.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index d363771a14..0ef508805a 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -159,6 +159,26 @@ emerge_to_image() { test_image_content "${root_fs_dir}" } +# emerge_to_image without a rootfs check; you should use emerge_to_image unless +# here's a good reason not to. +emerge_to_image_unchecked() { + local root_fs_dir="$1"; shift + + if [[ ${FLAGS_getbinpkg} -eq ${FLAGS_TRUE} ]]; then + set -- --getbinpkg "$@" + fi + + sudo -E ROOT="${root_fs_dir}" \ + PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \ + emerge --root-deps=rdeps --usepkgonly --jobs=$FLAGS_jobs -v "$@" + + # Shortcut if this was just baselayout + [[ "$*" == *sys-apps/baselayout ]] && return + + # Make sure profile.env has been generated + sudo -E ROOT="${root_fs_dir}" env-update --no-ldconfig +} + # Switch to the dev or prod sub-profile set_image_profile() { local suffix="$1"