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

index fc51c4ec2377a51e95017ebcd3fe7eb3107aeee7..3145a17b15539e2a25341b2196a445416a1e6b23 100644 (file)
@@ -291,19 +291,15 @@ if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
 python_gen_usedep() {
        debug-print-function ${FUNCNAME} "${@}"
 
-       local impl pattern
-       local matches=()
+       local impl matches=()
 
        for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
-               for pattern; do
-                       if [[ ${impl} == ${pattern} ]]; then
-                               matches+=(
-                                       "python_targets_${impl}(-)?"
-                                       "python_single_target_${impl}(+)?"
-                               )
-                               break
-                       fi
-               done
+               if _python_impl_matches "${impl}" "${@}"; then
+                       matches+=(
+                               "python_targets_${impl}(-)?"
+                               "python_single_target_${impl}(+)?"
+                       )
+               fi
        done
 
        [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}"