python-single-r1.eclass: python_gen_useflags, use _python_impl_matches()
authorMichał Górny <mgorny@gentoo.org>
Wed, 10 May 2017 15:25:17 +0000 (17:25 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 16 May 2017 17:11:35 +0000 (19:11 +0200)
eclass/python-single-r1.eclass

index 3145a17b15539e2a25341b2196a445416a1e6b23..e43057f26d6f8c50869c1bb71f514aa1360db880 100644 (file)
@@ -328,8 +328,7 @@ python_gen_usedep() {
 python_gen_useflags() {
        debug-print-function ${FUNCNAME} "${@}"
 
-       local flag_prefix impl pattern
-       local matches=()
+       local flag_prefix impl matches=()
 
        if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then
                flag_prefix=python_targets
@@ -338,12 +337,9 @@ python_gen_useflags() {
        fi
 
        for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
-               for pattern; do
-                       if [[ ${impl} == ${pattern} ]]; then
-                               matches+=( "${flag_prefix}_${impl}" )
-                               break
-                       fi
-               done
+               if _python_impl_matches "${impl}" "${@}"; then
+                       matches+=( "${flag_prefix}_${impl}" )
+               fi
        done
 
        echo "${matches[@]}"