diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-03-01 09:14:13 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-03-08 08:35:42 +0100 |
commit | 2980579f58b803d7c2ba9e6f374fdd5a40cb9339 (patch) | |
tree | 27aba38a62f38226750ef928cf41c7519eb5c1ea /eclass | |
parent | python-r1.eclass: localize variable to avoid leaking into the env (diff) | |
download | gentoo-2980579f58b803d7c2ba9e6f374fdd5a40cb9339.tar.gz gentoo-2980579f58b803d7c2ba9e6f374fdd5a40cb9339.tar.bz2 gentoo-2980579f58b803d7c2ba9e6f374fdd5a40cb9339.zip |
python-utils-r1.eclass: _python_set_impls, use local vars
Refactor _python_set_impls to use local variables throughout
the function and assign global values at the end. This prepares it for
double-inherit integrity checks. NFC.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/python-utils-r1.eclass | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 0cc5b963998e..a6f197bd418f 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -114,21 +114,22 @@ _python_set_impls() { _python_impl_supported "${i}" done - _PYTHON_SUPPORTED_IMPLS=() - _PYTHON_UNSUPPORTED_IMPLS=() + local supp=() unsupp=() for i in "${_PYTHON_ALL_IMPLS[@]}"; do if has "${i}" "${PYTHON_COMPAT[@]}"; then - _PYTHON_SUPPORTED_IMPLS+=( "${i}" ) + supp+=( "${i}" ) else - _PYTHON_UNSUPPORTED_IMPLS+=( "${i}" ) + unsupp+=( "${i}" ) fi done - if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 0 ]]; then + if [[ ! ${supp[@]} ]]; then die "No supported implementation in PYTHON_COMPAT." fi + _PYTHON_SUPPORTED_IMPLS=( "${supp[@]}" ) + _PYTHON_UNSUPPORTED_IMPLS=( "${unsupp[@]}" ) readonly _PYTHON_SUPPORTED_IMPLS _PYTHON_UNSUPPORTED_IMPLS } |