commit: 56bf65eee17557f8c673aa4238f5744ab2794e49
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 29 19:06:09 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 2 18:21:34 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56bf65ee
python-utils-r1.eclass: Fix shebangs using ${EPYTHON}, not ${PYTHON}
${PYTHON} points to BROOT's Python because it's usually used for calling
Python during the build. This value will be wrong at runtime after
building cross-prefix.
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/python-utils-r1.eclass | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 56b1b81edd2e..2555ce12d066 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1023,8 +1023,6 @@ python_fix_shebang() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${EPYTHON} ]] || die "${FUNCNAME}: EPYTHON unset (pkg_setup not
called?)"
- local PYTHON
- _python_export "${EPYTHON}" PYTHON
local force quiet
while [[ ${@} ]]; do
@@ -1097,7 +1095,7 @@ python_fix_shebang() {
if [[ ! ${error} ]]; then
debug-print "${FUNCNAME}: in file ${f#${D%/}}"
debug-print "${FUNCNAME}: rewriting shebang:
${shebang}"
- sed -i -e "1s@${from}@#!${PYTHON}@" "${f}" ||
die
+ sed -i -e
"1s@${from}@#!${EPREFIX}/usr/bin/${EPYTHON}@" "${f}" || die
any_fixed=1
else
eerror "The file has incompatible shebang:"