public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: James Le Cuirot <chewi@gentoo.org>
To: gentoo-dev <gentoo-dev@lists.gentoo.org>
Cc: James Le Cuirot <chewi@gentoo.org>
Subject: [gentoo-dev] [PATCH 2/2] python-utils-r1.eclass: Fix shebangs using ${EPYTHON}, not ${PYTHON}
Date: Sat, 29 Jul 2023 20:13:33 +0100	[thread overview]
Message-ID: <20230729191336.1751-2-chewi@gentoo.org> (raw)
In-Reply-To: <20230729191336.1751-1-chewi@gentoo.org>

${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@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:"
-- 
2.41.0



      reply	other threads:[~2023-07-29 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-29 19:13 [gentoo-dev] [PATCH 1/2] python-utils-r1.eclass: Remove old EAPI hack for exporting PYTHON James Le Cuirot
2023-07-29 19:13 ` James Le Cuirot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230729191336.1751-2-chewi@gentoo.org \
    --to=chewi@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox