mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-12 15:36:58 +02:00
Merge pull request #140 from marineam/fixpkgmixups
Fix building w/ --nogetbinpkg
This commit is contained in:
commit
8454976f2d
@ -174,6 +174,11 @@ install_cross_toolchain() {
|
|||||||
local cross_cfg="/usr/${cross_chost}/etc/portage/${cross_chost}-crossdev"
|
local cross_cfg="/usr/${cross_chost}/etc/portage/${cross_chost}-crossdev"
|
||||||
local cross_cfg_data=$(_crossdev_info "${cross_chost}" stable)
|
local cross_cfg_data=$(_crossdev_info "${cross_chost}" stable)
|
||||||
|
|
||||||
|
# Forcing binary packages for toolchain packages breaks crossdev since it
|
||||||
|
# prevents it from rebuilding with different use flags during bootstrap.
|
||||||
|
local safe_flags=( "${@/#--useoldpkg-atoms=*/}" )
|
||||||
|
safe_flags=( "${safe_flags[@]/#--rebuild-exclude=*/}" )
|
||||||
|
|
||||||
# may be called from either catalyst (root) or upgrade_chroot (user)
|
# may be called from either catalyst (root) or upgrade_chroot (user)
|
||||||
local sudo=
|
local sudo=
|
||||||
if [[ $(id -u) -ne 0 ]]; then
|
if [[ $(id -u) -ne 0 ]]; then
|
||||||
@ -183,7 +188,7 @@ install_cross_toolchain() {
|
|||||||
# Only call crossdev to regenerate configs if something has changed
|
# Only call crossdev to regenerate configs if something has changed
|
||||||
if ! cmp --quiet - "${cross_cfg}" <<<"${cross_cfg_data}"
|
if ! cmp --quiet - "${cross_cfg}" <<<"${cross_cfg_data}"
|
||||||
then
|
then
|
||||||
$sudo crossdev --stable --portage "$*" \
|
$sudo crossdev --stable --portage "${safe_flags[*]}" \
|
||||||
--init-target --target "${cross_chost}"
|
--init-target --target "${cross_chost}"
|
||||||
$sudo tee "${cross_cfg}" <<<"${cross_cfg_data}" >/dev/null
|
$sudo tee "${cross_cfg}" <<<"${cross_cfg_data}" >/dev/null
|
||||||
fi
|
fi
|
||||||
@ -193,7 +198,7 @@ install_cross_toolchain() {
|
|||||||
if emerge "$@" --binpkg-respect-use=y --update --newuse \
|
if emerge "$@" --binpkg-respect-use=y --update --newuse \
|
||||||
--pretend "${cross_pkgs[@]}" | grep -q '^\[ebuild'
|
--pretend "${cross_pkgs[@]}" | grep -q '^\[ebuild'
|
||||||
then
|
then
|
||||||
$sudo crossdev --stable --portage "$*" \
|
$sudo crossdev --stable --portage "${safe_flags[*]}" \
|
||||||
--stage4 --target "${cross_chost}"
|
--stage4 --target "${cross_chost}"
|
||||||
else
|
else
|
||||||
$sudo emerge "$@" --binpkg-respect-use=y --update --newuse \
|
$sudo emerge "$@" --binpkg-respect-use=y --update --newuse \
|
||||||
|
@ -258,7 +258,9 @@ if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then
|
|||||||
EMERGE_FLAGS+=" --jobs=${FLAGS_jobs}"
|
EMERGE_FLAGS+=" --jobs=${FLAGS_jobs}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]]; then
|
if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" && \
|
||||||
|
"${FLAGS_getbinpkg}" -eq "${FLAGS_TRUE}" ]]
|
||||||
|
then
|
||||||
EMERGE_FLAGS+=" --usepkgonly --getbinpkg"
|
EMERGE_FLAGS+=" --usepkgonly --getbinpkg"
|
||||||
else
|
else
|
||||||
# When binary packages are disabled we need to make sure the cross
|
# When binary packages are disabled we need to make sure the cross
|
||||||
|
Loading…
Reference in New Issue
Block a user