Use the wheel name returned by build_wheel() rather than trying to guess
it from WHEEL_DIR.

Signed-off-by: Michał Górny <mgo...@gentoo.org>
---
 eclass/distutils-r1.eclass | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 81eea83c67b3..22070f6b74f4 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1032,22 +1032,18 @@ distutils-r1_python_compile() {
 
                local build_backend=$(_distutils-r1_get_backend)
                einfo "  Building the wheel via ${build_backend}"
-               "${EPYTHON}" -c "import ${build_backend%:*}; \
+               local wheel=$("${EPYTHON}" -c "import ${build_backend%:*}; \
                        import os; \
-                       
${build_backend/:/.}.build_wheel(os.environ['WHEEL_BUILD_DIR'])" ||
-                       die "Wheel build failed"
-
-               local wheel=( "${WHEEL_BUILD_DIR}"/*.whl )
-               if [[ ${#wheel[@]} -ne 1 ]]; then
-                       die "Incorrect number of wheels created (${#wheel[@]}): 
${wheel[*]}"
-               fi
+                       
print(${build_backend/:/.}.build_wheel(os.environ['WHEEL_BUILD_DIR']))" ||
+                       die "Wheel build failed")
+               [[ -n ${wheel} ]] || die "No wheel name returned"
 
                local root=${BUILD_DIR}/install
                einfo "  Installing the wheel to ${root}"
                # NB: --compile-bytecode does not produce the correct paths,
                # and python_optimize doesn't handle being called outside D,
                # so we just defer compiling until the final merge
-               "${EPYTHON}" -m installer -d "${root}" "${wheel}" \
+               "${EPYTHON}" -m installer -d "${root}" 
"${WHEEL_BUILD_DIR}/${wheel}" \
                        --no-compile-bytecode ||
                        die "installer failed"
 
-- 
2.35.1


Reply via email to