commit:     e9992f0e5c94bd23f9d4effec8600bb4d0be1a8c
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed May 28 01:31:35 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 30 07:30:36 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9992f0e

isolated-functions.sh: drop the __bashpid() function

Given a target of bash-4.2, it's no longer needed.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ebuild.sh             |  2 +-
 bin/estrip                |  4 ++--
 bin/isolated-functions.sh | 11 ++---------
 bin/phase-functions.sh    |  2 +-
 bin/phase-helpers.sh      |  2 +-
 bin/save-ebuild-env.sh    |  2 +-
 6 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 63ca68c8c4..832a85affa 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -549,7 +549,7 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
 fi
 
 # Subshell/helper die support (must export for the die helper).
-export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
+export EBUILD_MASTER_PID=${BASHPID}
 trap 'exit 1' SIGTERM
 
 if [[ ${EBUILD_PHASE} != @(clean|cleanrm|depend) ]] && ! [[ ${EBUILD_PHASE} == 
setup && ${EMERGE_FROM} == ebuild ]] && [[ -f ${T}/environment ]]

diff --git a/bin/estrip b/bin/estrip
index 592aee24f7..136615eaaa 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -234,7 +234,7 @@ save_elf_sources() {
        buildid=$("${debugedit}" -i \
                -b "${WORKDIR}" \
                -d "${prepstrip_sources_dir}" \
-               -l "${tmpdir}/sources/${x##*/}.${BASHPID:-$(__bashpid)}" \
+               -l "${tmpdir}/sources/${x##*/}.${BASHPID}" \
                "${x}")
 }
 
@@ -389,7 +389,7 @@ process_elf() {
                # See if we can split & strip at the same time
                if ${splitdebug} && [[ -n ${SPLIT_STRIP_FLAGS} ]] ; then
                        local shortname="${x##*/}.debug"
-                       local 
splitdebug="${tmpdir}/splitdebug/${shortname}.${BASHPID:-$(__bashpid)}"
+                       local 
splitdebug="${tmpdir}/splitdebug/${shortname}.${BASHPID}"
 
                        ${already_stripped} || \
                        ${STRIP} ${strip_flags} \

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 18ee80597d..7ce43541c1 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -109,13 +109,6 @@ nonfatal() {
        PORTAGE_NONFATAL=1 "$@"
 }
 
-__bashpid() {
-       # The BASHPID variable is new to bash-4.0, so add a hack for older
-       # versions.  This must be used like so:
-       # ${BASHPID:-$(__bashpid)}
-       sh -c 'echo ${PPID}'
-}
-
 __helpers_die() {
        if ___eapi_helpers_can_die && [[ ${PORTAGE_NONFATAL} != 1 ]]; then
                die "$@"
@@ -242,8 +235,8 @@ die() {
        [[ -n ${PORTAGE_IPC_DAEMON} ]] && "${PORTAGE_BIN_PATH}"/ebuild-ipc exit 
1
 
        # subshell die support
-       if [[ -n ${EBUILD_MASTER_PID} && ${BASHPID:-$(__bashpid)} != 
${EBUILD_MASTER_PID} ]] ; then
-               kill -s SIGTERM ${EBUILD_MASTER_PID}
+       if [[ -n ${EBUILD_MASTER_PID} && ${BASHPID} != "${EBUILD_MASTER_PID}" 
]] ; then
+               kill -s SIGTERM "${EBUILD_MASTER_PID}"
        fi
        exit 1
 }

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index fa824b99d5..830ba451cf 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -963,7 +963,7 @@ __ebuild_main() {
        # setup EBUILD_MASTER_PID to refer to the current ${BASHPID},
        # which seems to give the best results when further
        # nested subshells call die.
-       export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
+       export EBUILD_MASTER_PID=${BASHPID}
        trap 'exit 1' SIGTERM
 
        if [[ -v PORTAGE_EBUILD_EXTRA_SOURCE &&

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index a4bf8328d9..26f8c6f903 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -490,7 +490,7 @@ unpack() {
 
 econf() {
        local x
-       local pid=${BASHPID:-$(__bashpid)}
+       local pid=${BASHPID}
 
        if ! ___eapi_has_prefix_variables; then
                local EPREFIX=

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 25f885f961..98f03bd000 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -79,7 +79,7 @@ __save_ebuild_env() {
                __ebuild_arg_to_phase __ebuild_phase_funcs default \
                __unpack_tar __unset_colors \
                __source_env_files __try_source __check_bash_version \
-               __bashpid __start_distcc \
+               __start_distcc \
                __eqaquote __eqatag \
                __eapi7_ver_parse_range __eapi7_ver_split \
                __eapi7_ver_compare_int __eapi7_ver_compare \

Reply via email to