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