diff options
author | Michał Górny <mgorny@gentoo.org> | 2015-12-12 23:12:10 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2015-12-22 23:12:23 +0100 |
commit | 3923a952a771f567bb620cac42c4c4f2415db8d2 (patch) | |
tree | fd7281b655a4b0a9321e9849acb08ce118119058 /eclass/python-single-r1.eclass | |
parent | python*-r1.eclass: Commonize PYTHON_COMPAT processing, cache the result (diff) | |
download | gentoo-3923a952a771f567bb620cac42c4c4f2415db8d2.tar.gz gentoo-3923a952a771f567bb620cac42c4c4f2415db8d2.tar.bz2 gentoo-3923a952a771f567bb620cac42c4c4f2415db8d2.zip |
python-single-r1.eclass: Fix python_gen_* w/ single PYTHON_COMPAT impl
Fix python_gen_useflags() and python_gen_cond_dep() to output correct
flag name when only a single implementation is listed in PYTHON_COMPAT.
In this case, the PYTHON_SINGLE_TARGET flags are not emitted
and PYTHON_TARGETS are used directly instead.
Diffstat (limited to 'eclass/python-single-r1.eclass')
-rw-r--r-- | eclass/python-single-r1.eclass | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index 8ef3846dd6ac..4c4f0576b860 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -310,13 +310,19 @@ python_gen_usedep() { python_gen_useflags() { debug-print-function ${FUNCNAME} "${@}" - local impl pattern + local flag_prefix impl pattern local matches=() + if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then + flag_prefix=python_targets + else + flag_prefix=python_single_target + fi + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do for pattern; do if [[ ${impl} == ${pattern} ]]; then - matches+=( "python_single_target_${impl}" ) + matches+=( "${flag_prefix}_${impl}" ) break fi done @@ -354,9 +360,15 @@ python_gen_useflags() { python_gen_cond_dep() { debug-print-function ${FUNCNAME} "${@}" - local impl pattern + local flag_prefix impl pattern local matches=() + if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then + flag_prefix=python_targets + else + flag_prefix=python_single_target + fi + local dep=${1} shift @@ -371,7 +383,7 @@ python_gen_cond_dep() { dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}} fi - matches+=( "python_single_target_${impl}? ( ${dep} )" ) + matches+=( "${flag_prefix}_${impl}? ( ${dep} )" ) break fi done |