From 13d401b11a3616eb99b7eeb6f2b06f1ab9b8e114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 27 Oct 2020 16:06:38 +0000 Subject: [PATCH] Hardcode %{_bindir} into python-config script + remove unreachable error handling The `dirname $0` breaks the script when it is linked to a different location, for example the RHEL's /usr/libexec/platform-python-config. The error handling was never reachable, failed exec ends the script. See https://src.fedoraproject.org/rpms/python3.9/pull-request/38 --- python3.10.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python3.10.spec b/python3.10.spec index f1ac7b5..dfd99f7 100644 --- a/python3.10.spec +++ b/python3.10.spec @@ -824,9 +824,7 @@ InstallPython() { # Rename the -devel script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python${LDVersion}-{,`uname -m`-}config - echo -e '#!/bin/sh\nexec `dirname $0`/python'${LDVersion}'-`uname -m`-config "$@"' > \ - %{buildroot}%{_bindir}/python${LDVersion}-config - echo '[ $? -eq 127 ] && echo "Could not find python'${LDVersion}'-`uname -m`-config. Look around to see available arches." >&2' >> \ + echo -e '#!/bin/sh\nexec %{_bindir}/python'${LDVersion}'-`uname -m`-config "$@"' > \ %{buildroot}%{_bindir}/python${LDVersion}-config chmod +x %{buildroot}%{_bindir}/python${LDVersion}-config