From e93ca9b43cf5aa4e58c9557f561f7dbafbabe893 Mon Sep 17 00:00:00 2001 From: Mitchell Allain Date: Sun, 28 Jul 2024 17:20:44 -0700 Subject: [PATCH] Change from status to retval --- pkgs/stdenv/generic/setup.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 0de3edfc7587..9043b3c710ad 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -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 }