1 |
This will handle migrating/fixing user settings. In this particular |
2 |
case, it's needed to write /etc/env.d/python/python* files on |
3 |
eselect-python upgrade. |
4 |
--- |
5 |
python.eselect | 10 ++++++++-- |
6 |
1 file changed, 8 insertions(+), 2 deletions(-) |
7 |
|
8 |
diff --git a/python.eselect b/python.eselect |
9 |
index 8d4858a..f69d5df 100644 |
10 |
--- a/python.eselect |
11 |
+++ b/python.eselect |
12 |
@@ -382,10 +382,16 @@ do_update() { |
13 |
|
14 |
if [[ "${if_unset}" == "1" && -f "${INTERPRETER_PATH}python" && -f "${ENV_D_PATH}/python/config" ]]; then |
15 |
if [[ "${python2}" == "1" && -f "${INTERPRETER_PATH}python2" ]]; then |
16 |
- return |
17 |
+ target="$(readlink "${INTERPRETER_PATH}python2")" |
18 |
elif [[ "${python3}" == "1" && -f "${INTERPRETER_PATH}python3" ]]; then |
19 |
- return |
20 |
+ target="$(readlink "${INTERPRETER_PATH}python3")" |
21 |
elif [[ "${python2}" == "0" && "${python3}" == "0" ]]; then |
22 |
+ target="$(<"${ENV_D_PATH}/python/config")" |
23 |
+ fi |
24 |
+ |
25 |
+ if [[ ${target} ]]; then |
26 |
+ echo "Resetting ${target}" |
27 |
+ do_set ${python_version_option} ${target} |
28 |
return |
29 |
fi |
30 |
fi |
31 |
-- |
32 |
1.7.12.4 |