Change from status to retval

This commit is contained in:
Mitchell Allain
2024-07-28 17:41:41 -07:00
parent 8e1442adb2
commit e93ca9b43c
+4 -8
View File
@@ -1624,7 +1624,7 @@ showPhaseFooter() {
runPhase() {
local status=0
local retval=0
local curPhase="$*"
if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then return; fi
if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then return; fi
@@ -1645,14 +1645,10 @@ runPhase() {
startTime=$(date +"%s")
# Evaluate the variable named $curPhase if it exists, otherwise the
# function named $curPhase. Trap errors in subshell to set error status.
trap 'status=1; trap - ERR' ERR
# function named $curPhase. Trap errors in subshell to set non-zero retval.
trap 'retval=1; trap - ERR' ERR
eval "set -o errtrace; ${!curPhase:-$curPhase}"
# Evaluate the variable named $curPhase if it exists, otherwise the
# function named $curPhase.
eval "${!curPhase:-$curPhase}"
endTime=$(date +"%s")
showPhaseFooter "$curPhase" "$startTime" "$endTime"
@@ -1664,7 +1660,7 @@ runPhase() {
cd -- "${sourceRoot:-.}"
fi
return $status
return $retval
}