1 |
commit: 01e902405dd6552763cf66e4077f801a65bc244b |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Dec 11 21:26:45 2015 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 11 22:42:33 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01e90240 |
7 |
|
8 |
python*-r1.eclass: Replace non-portable use of 'declare -g' |
9 |
|
10 |
Replace uses of 'declare -g -r' (bash-4.2+) with 'readonly'. Reported |
11 |
by Arfrever. This time use split assignments followed by readonly calls |
12 |
since combined calls work unreliably. |
13 |
|
14 |
eclass/python-any-r1.eclass | 3 ++- |
15 |
eclass/python-r1.eclass | 6 +++--- |
16 |
eclass/python-single-r1.eclass | 4 ++-- |
17 |
eclass/python-utils-r1.eclass | 3 ++- |
18 |
4 files changed, 9 insertions(+), 7 deletions(-) |
19 |
|
20 |
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass |
21 |
index 82ead76..721ba45 100644 |
22 |
--- a/eclass/python-any-r1.eclass |
23 |
+++ b/eclass/python-any-r1.eclass |
24 |
@@ -133,7 +133,8 @@ _python_any_set_globals() { |
25 |
|
26 |
PYTHON_DEPS="${PYTHON_PKG_DEP} ${PYTHON_DEPS}" |
27 |
done |
28 |
- declare -g -r PYTHON_DEPS="|| ( ${PYTHON_DEPS})" |
29 |
+ PYTHON_DEPS="|| ( ${PYTHON_DEPS})" |
30 |
+ readonly PYTHON_DEPS |
31 |
} |
32 |
_python_any_set_globals |
33 |
unset -f _python_any_set_globals |
34 |
|
35 |
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass |
36 |
index 4b9c6f3..fbc39dc 100644 |
37 |
--- a/eclass/python-r1.eclass |
38 |
+++ b/eclass/python-r1.eclass |
39 |
@@ -216,8 +216,8 @@ _python_set_globals() { |
40 |
optflags+=,${flags_st[@]/%/(-)} |
41 |
|
42 |
IUSE=${flags[*]} |
43 |
- declare -g -r PYTHON_REQUIRED_USE="|| ( ${flags[*]} )" |
44 |
- declare -g -r PYTHON_USEDEP=${optflags// /,} |
45 |
+ PYTHON_REQUIRED_USE="|| ( ${flags[*]} )" |
46 |
+ PYTHON_USEDEP=${optflags// /,} |
47 |
|
48 |
# 1) well, python-exec would suffice as an RDEP |
49 |
# but no point in making this overcomplex, BDEP doesn't hurt anyone |
50 |
@@ -232,7 +232,7 @@ _python_set_globals() { |
51 |
else |
52 |
PYTHON_DEPS+="dev-lang/python-exec:2[${PYTHON_USEDEP}]" |
53 |
fi |
54 |
- readonly PYTHON_DEPS |
55 |
+ readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP |
56 |
} |
57 |
_python_set_globals |
58 |
unset -f _python_set_globals |
59 |
|
60 |
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass |
61 |
index 1582295..b8684f0 100644 |
62 |
--- a/eclass/python-single-r1.eclass |
63 |
+++ b/eclass/python-single-r1.eclass |
64 |
@@ -238,7 +238,7 @@ _python_single_set_globals() { |
65 |
PYTHON_DEPS+="python_single_target_${i}? ( ${PYTHON_PKG_DEP} ) " |
66 |
done |
67 |
fi |
68 |
- declare -g -r PYTHON_USEDEP=${optflags// /,} |
69 |
+ PYTHON_USEDEP=${optflags// /,} |
70 |
|
71 |
# 1) well, python-exec would suffice as an RDEP |
72 |
# but no point in making this overcomplex, BDEP doesn't hurt anyone |
73 |
@@ -253,7 +253,7 @@ _python_single_set_globals() { |
74 |
else |
75 |
PYTHON_DEPS+="dev-lang/python-exec:2[${PYTHON_USEDEP}]" |
76 |
fi |
77 |
- readonly PYTHON_DEPS PYTHON_REQUIRED_USE |
78 |
+ readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP |
79 |
} |
80 |
_python_single_set_globals |
81 |
unset -f _python_single_set_globals |
82 |
|
83 |
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass |
84 |
index cf0e134..7830323 100644 |
85 |
--- a/eclass/python-utils-r1.eclass |
86 |
+++ b/eclass/python-utils-r1.eclass |
87 |
@@ -40,12 +40,13 @@ inherit toolchain-funcs |
88 |
# @INTERNAL |
89 |
# @DESCRIPTION: |
90 |
# All supported Python implementations, most preferred last. |
91 |
-declare -g -r _PYTHON_ALL_IMPLS=( |
92 |
+_PYTHON_ALL_IMPLS=( |
93 |
python2_7 |
94 |
python3_3 python3_4 python3_5 |
95 |
pypy pypy3 |
96 |
jython2_7 |
97 |
) |
98 |
+readonly _PYTHON_ALL_IMPLS |
99 |
|
100 |
# @FUNCTION: _python_impl_supported |
101 |
# @USAGE: <impl> |