--- python.eclass +++ python.eclass @@ -775,8 +775,9 @@ _python_initial_sanity_checks if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" != "declare -x PYTHON_ABIS="* ]] && has "${EAPI:-0}" 0 1 2 3; then - local PYTHON_ABI restricted_ABI support_ABI supported_PYTHON_ABIS= - PYTHON_ABI_SUPPORTED_VALUES="${_CPYTHON2_SUPPORTED_ABIS[@]} ${_CPYTHON3_SUPPORTED_ABIS[@]} ${_JYTHON_SUPPORTED_ABIS[@]}" + local PYTHON_ABI restricted_ABI restricted_ABIs support_ABI supported_PYTHON_ABIS + + restricted_ABIs="${RESTRICT_PYTHON_ABIS// /$'\n'}" if [[ "$(declare -p USE_PYTHON 2> /dev/null)" == "declare -x USE_PYTHON="* ]]; then local cpython_enabled="0" @@ -786,7 +787,7 @@ fi for PYTHON_ABI in ${USE_PYTHON}; do - if ! has "${PYTHON_ABI}" ${PYTHON_ABI_SUPPORTED_VALUES}; then + if ! has "${PYTHON_ABI}" ${_PYTHON_SUPPORTED_ABIS[@]}; then die "USE_PYTHON variable contains invalid value '${PYTHON_ABI}'" fi @@ -795,12 +796,12 @@ fi support_ABI="1" - for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do + while read restricted_ABI; do if [[ "${PYTHON_ABI}" == ${restricted_ABI} ]]; then support_ABI="0" break fi - done + done <<< "${restricted_ABIs}" [[ "${support_ABI}" == "1" ]] && export PYTHON_ABIS+="${PYTHON_ABIS:+ }${PYTHON_ABI}" done @@ -829,19 +830,19 @@ for PYTHON_ABI in "${_CPYTHON2_SUPPORTED_ABIS[@]}"; do support_python_major_version="1" - for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do + while read restricted_ABI; do if [[ "${PYTHON_ABI}" == ${restricted_ABI} ]]; then support_python_major_version="0" fi - done + done <<< "${restricted_ABIs}" [[ "${support_python_major_version}" == "1" ]] && break done if [[ "${support_python_major_version}" == "1" ]]; then - for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do + while read restricted_ABI; do if [[ "${python2_version}" == ${restricted_ABI} ]]; then die "Active version of Python 2 is not supported by ${CATEGORY}/${PF}" fi - done + done <<< "${restricted_ABIs}" else python2_version="" fi @@ -856,19 +857,19 @@ for PYTHON_ABI in "${_CPYTHON3_SUPPORTED_ABIS[@]}"; do support_python_major_version="1" - for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do + while read restricted_ABI; do if [[ "${PYTHON_ABI}" == ${restricted_ABI} ]]; then support_python_major_version="0" fi - done + done <<< "${restricted_ABIs}" [[ "${support_python_major_version}" == "1" ]] && break done if [[ "${support_python_major_version}" == "1" ]]; then - for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do + while read restricted_ABI; do if [[ "${python3_version}" == ${restricted_ABI} ]]; then die "Active version of Python 3 is not supported by ${CATEGORY}/${PF}" fi - done + done <<< "${restricted_ABIs}" else python3_version="" fi