commit: 6dc38bd8eaa983a25f061831f7921f3e562a6038
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 9 10:46:37 2019 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jan 9 13:49:00 2019 +0000
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6dc38bd8
scripts/bootstrap-prefix: allow resume of stage3 after python-exec
Portage installs python-exec also in ROOT/tmp, which foobars the
manually bootstrapped python installation there, rendering it broken.
In a successful bootstrap this goes unnoticed, because the running
Portage (=Python) session installs Python later in the same merge
sequence. As such, after that emerge, the python from ROOT is picked
up. If we failed on one of the packages between python-exec and python,
however (~60 pkgs inbetween, including a compiler) we leave the setup in
a broken state.
Hence, prior to starting stage3, re-new the Python 2.7 symlinks to deal
with the scenario of resuming a broken off stage3. Since ROOT/tmp gets
removed shortly after Python gets installed in ROOT, it is fine that we
effectively kill python-exec in ROOT/tmp here.
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
scripts/bootstrap-prefix.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index e547e6d1bf..9ce12729e3 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1670,6 +1670,15 @@ bootstrap_stage3() {
fi
fi
+ # if we resume this stage and python-exec was installed already in
+ # tmp, we basically made the system unusable, so remove python-exec
+ # here so we can use the python in tmp
+ for pef in python{,2} python{,2}-config ; do
+ rm -f "${ROOT}"/tmp/usr/bin/${pef}
+ [[ ${pef} == *-config ]] && ppf=-config || ppf=
+ ( cd "${ROOT}"/tmp/usr/bin && ln -s python2.7${ppf} ${pef} )
+ done
+
get_libdir() {
local l=$(portageq envvar LIBDIR_$(portageq envvar ABI)
2>/dev/null)
[[ -z ${l} ]] && l=lib