buildid=$(debugedit -i \
-b "${WORKDIR}" \
-d "${prepstrip_sources_dir}" \
- -l "${tmpdir}/sources/${x##*/}.${BASHPID}" \
+ -l "${tmpdir}/sources/${x##*/}.${BASHPID:-$(__bashpid)}" \
"${x}")
}
# see if we can split & strip at the same time
if [[ -n ${SPLIT_STRIP_FLAGS} ]] ; then
local shortname="${x##*/}.debug"
- local splitdebug="${tmpdir}/splitdebug/${shortname}.${BASHPID}"
+ local splitdebug="${tmpdir}/splitdebug/${shortname}.${BASHPID:-$(__bashpid)}"
${already_stripped} || \
${STRIP} ${strip_flags} \
-f "${splitdebug}" \
fi
# Subshell/helper die support (must export for the die helper).
-export EBUILD_MASTER_PID=$BASHPID
+export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
trap 'exit 1' SIGTERM
if ! has "$EBUILD_PHASE" clean cleanrm depend && \
}
__multijob_child_init() {
- trap 'echo ${BASHPID} $? >&'${mj_write_fd} EXIT
+ trap 'echo ${BASHPID:-$(__bashpid)} $? >&'${mj_write_fd} EXIT
trap 'exit 1' INT TERM
}
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; then
die "$@"
[[ -n $PORTAGE_IPC_DAEMON ]] && "$PORTAGE_BIN_PATH"/ebuild-ipc exit 1
# subshell die support
- [[ $BASHPID = $EBUILD_MASTER_PID ]] || kill -s SIGTERM $EBUILD_MASTER_PID
+ [[ ${BASHPID:-$(__bashpid)} == ${EBUILD_MASTER_PID} ]] || kill -s SIGTERM ${EBUILD_MASTER_PID}
exit 1
}
# 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
+ export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
trap 'exit 1' SIGTERM
#a reasonable default for $S
econf() {
local x
- local pid=${BASHPID}
+ local pid=${BASHPID:-$(__bashpid)}
if ! ___eapi_has_prefix_variables; then
local EPREFIX=