mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-21 11:34:13 +00:00
stdenv: runPhase
returns status (#330751)
This commit is contained in:
commit
6f40e94649
@ -1694,6 +1694,7 @@ showPhaseFooter() {
|
||||
|
||||
|
||||
runPhase() {
|
||||
local retval=0
|
||||
local curPhase="$*"
|
||||
if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then return; fi
|
||||
if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then return; fi
|
||||
@ -1712,8 +1713,9 @@ runPhase() {
|
||||
startTime=$(date +"%s")
|
||||
|
||||
# Evaluate the variable named $curPhase if it exists, otherwise the
|
||||
# function named $curPhase.
|
||||
eval "${!curPhase:-$curPhase}"
|
||||
# function named $curPhase. Trap errors in subshell to set non-zero retval.
|
||||
trap 'retval=1; trap - ERR' ERR
|
||||
eval "set -o errtrace; ${!curPhase:-$curPhase}"
|
||||
|
||||
endTime=$(date +"%s")
|
||||
|
||||
@ -1725,6 +1727,8 @@ runPhase() {
|
||||
|
||||
cd -- "${sourceRoot:-.}"
|
||||
fi
|
||||
|
||||
return $retval
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user