• [gentoo-dev] [PATCH 1/2] python-utils-r1.eclass: Remove old EAPI hack f

    From James Le Cuirot@21:1/5 to All on Sat Jul 29 21:20:01 2023
    This eclass is EAPI 7+ now, so we can assume that BROOT is available.
    This was broken anyway because it seems that Portage doesn't set BROOT
    when it's empty.

    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a883135eaa41..56b1b81edd2e 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -338,7 +338,7 @@ _python_export() {
    debug-print "${FUNCNAME}: EPYTHON = ${EPYTHON}"
    ;;
    PYTHON)
    - export PYTHON=${BROOT-${EPREFIX}}/usr/bin/${impl}
    + export PYTHON=${BROOT}/usr/bin/${impl}
    debug-print "${FUNCNAME}: PYTHON = ${PYTHON}"
    ;;
    PYTHON_SITEDIR)
    --
    2.41.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Le Cuirot@21:1/5 to All on Sat Jul 29 21:20:01 2023
    ${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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Use