From 9d28b2b829e0d636905f48a7aad009f0a70b9afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 27 Oct 2020 17:04:17 +0100 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.9.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python3.9.spec b/python3.9.spec index 90ae89b..d47cf37 100644 --- a/python3.9.spec +++ b/python3.9.spec @@ -901,9 +901,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