Help PMs figure out what to do by turning off unimplemented python_single_target_...
authorIan Stakenvicius <axs@gentoo.org>
Fri, 7 Nov 2014 18:11:58 +0000 (18:11 +0000)
committerIan Stakenvicius <axs@gentoo.org>
Fri, 7 Nov 2014 18:11:58 +0000 (18:11 +0000)
eclass/ChangeLog
eclass/python-single-r1.eclass

index 3a9ace284fe5d54c82136008b323f6e8d0508a1f..46e3c24f8cec0d20cb746cc6c7b00cac0898f8b7 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1406 2014/11/07 16:17:46 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1407 2014/11/07 18:11:58 axs Exp $
+
+  07 Nov 2014; Ian Stakenvicius (_AxS_) <axs@gentoo.org>
+  python-single-r1.eclass:
+  Help PMs figure out what to do by turning off unimplemented
+  python_single_target_* flags in PYTHON_USEDEP; thanks to mgorny, floppym and
+  Arfever for reviews
 
   07 Nov 2014; Ian Stakenvicius (_AxS_) <axs@gentoo.org>
   python-single-r1.eclass:
index 8dbcf767af5546f0b121fa3db6f9497d141bd214..8e7fcf2926ea4770477ffd0e032713d8e073e25c 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-single-r1.eclass,v 1.28 2014/11/07 16:17:46 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-single-r1.eclass,v 1.29 2014/11/07 18:11:58 axs Exp $
 
 # @ECLASS: python-single-r1
 # @MAINTAINER:
@@ -159,12 +159,14 @@ fi
 
 _python_single_set_globals() {
        local impls=()
+       local unimpls=()
 
        PYTHON_DEPS=
        local i PYTHON_PKG_DEP
-       for i in "${PYTHON_COMPAT[@]}"; do
-               _python_impl_supported "${i}" || continue
-               impls+=( "${i}" )
+       for i in "${_PYTHON_ALL_IMPLS[@]}"; do
+               has "${i}" "${PYTHON_COMPAT[@]}" \
+                       && impls+=( "${i}" ) \
+                       || unimpls+=( "${i}" )
        done
 
        if [[ ${#impls[@]} -eq 0 ]]; then
@@ -173,8 +175,9 @@ _python_single_set_globals() {
 
        local flags_mt=( "${impls[@]/#/python_targets_}" )
        local flags=( "${impls[@]/#/python_single_target_}" )
+       local unflags=( "${unimpls[@]/#/-python_single_target_}" )
 
-       local optflags=${flags_mt[@]/%/(-)?}
+       local optflags=${flags_mt[@]/%/(-)?},${unflags[@]/%/(-)}
 
        IUSE="${flags_mt[*]}"
 
@@ -195,7 +198,7 @@ _python_single_set_globals() {
                PYTHON_REQUIRED_USE="^^ ( ${flags[*]} )"
                # Ensure deps honor the same python_single_target_* flag as is set
                # on this package.
-       optflags+=,${flags[@]/%/(+)?}
+               optflags+=,${flags[@]/%/(+)?}
 
                for i in "${impls[@]}"; do
                        # The chosen targets need to be in PYTHON_TARGETS as well.