about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2022-08-17 15:00:00 -0500
committerYt <happysalada@proton.me>2022-08-21 23:01:55 -0400
commitec4019f6dcecbacb1c07882d8bb1fac021e8873b (patch)
tree868e0d6dea0302bf82372f3e4b9baa34ae82cdeb /pkgs/stdenv
parent7efd61a09a17bb43278a39958a64444832b268b9 (diff)
Set inherit_errexit after bash version check
inherit_errexit wasn’t available in bash 3. We have a check to show a
nice error message, but that check is after we set inherit_errexit in
setup.sh. So we can just move this to below the BASH_VERSINFO check.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/setup.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 0ba8d10182337..f0fcb30451dd8 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -2,7 +2,6 @@
 __nixpkgs_setup_set_original=$-
 set -eu
 set -o pipefail
-shopt -s inherit_errexit
 
 if [[ -n "${BASH_VERSINFO-}" && "${BASH_VERSINFO-}" -lt 4 ]]; then
     echo "Detected Bash version that isn't supported by Nixpkgs (${BASH_VERSION})"
@@ -10,6 +9,8 @@ if [[ -n "${BASH_VERSINFO-}" && "${BASH_VERSINFO-}" -lt 4 ]]; then
     exit 1
 fi
 
+shopt -s inherit_errexit
+
 if (( "${NIX_DEBUG:-0}" >= 6 )); then
     set -x
 fi