1 |
commit: 2980579f58b803d7c2ba9e6f374fdd5a40cb9339 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 1 08:14:13 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 8 07:35:42 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2980579f |
7 |
|
8 |
python-utils-r1.eclass: _python_set_impls, use local vars |
9 |
|
10 |
Refactor _python_set_impls to use local variables throughout |
11 |
the function and assign global values at the end. This prepares it for |
12 |
double-inherit integrity checks. NFC. |
13 |
|
14 |
eclass/python-utils-r1.eclass | 11 ++++++----- |
15 |
1 file changed, 6 insertions(+), 5 deletions(-) |
16 |
|
17 |
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass |
18 |
index 0cc5b963998..a6f197bd418 100644 |
19 |
--- a/eclass/python-utils-r1.eclass |
20 |
+++ b/eclass/python-utils-r1.eclass |
21 |
@@ -114,21 +114,22 @@ _python_set_impls() { |
22 |
_python_impl_supported "${i}" |
23 |
done |
24 |
|
25 |
- _PYTHON_SUPPORTED_IMPLS=() |
26 |
- _PYTHON_UNSUPPORTED_IMPLS=() |
27 |
+ local supp=() unsupp=() |
28 |
|
29 |
for i in "${_PYTHON_ALL_IMPLS[@]}"; do |
30 |
if has "${i}" "${PYTHON_COMPAT[@]}"; then |
31 |
- _PYTHON_SUPPORTED_IMPLS+=( "${i}" ) |
32 |
+ supp+=( "${i}" ) |
33 |
else |
34 |
- _PYTHON_UNSUPPORTED_IMPLS+=( "${i}" ) |
35 |
+ unsupp+=( "${i}" ) |
36 |
fi |
37 |
done |
38 |
|
39 |
- if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 0 ]]; then |
40 |
+ if [[ ! ${supp[@]} ]]; then |
41 |
die "No supported implementation in PYTHON_COMPAT." |
42 |
fi |
43 |
|
44 |
+ _PYTHON_SUPPORTED_IMPLS=( "${supp[@]}" ) |
45 |
+ _PYTHON_UNSUPPORTED_IMPLS=( "${unsupp[@]}" ) |
46 |
readonly _PYTHON_SUPPORTED_IMPLS _PYTHON_UNSUPPORTED_IMPLS |
47 |
} |