aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/roundup/roundup-fix-busybox-shell-opts.patch
blob: b6185e96abb130ef8319fbb37c19047db9d2e99d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/roundup.sh b/roundup.sh
index d7465dc..38d7efe 100755
--- a/roundup.sh
+++ b/roundup.sh
@@ -258,9 +258,11 @@ do
 
                 # exit subshell with return code of last failing command. This
                 # is needed to see the return code 253 on failed assumptions.
-                # But, only do this if the error handling is activated.
-                set -E
-                trap 'rc=$?; set +x; set -o | grep "errexit.*on" >/dev/null && exit $rc' ERR
+                # But, only do this if the error handling is activated and only if the shell supports it
+                if set -o | grep "^errtrace" >/dev/null; then
+                  set -o errtrace
+                  trap 'rc=$?; set +x; set -o | grep "errexit.*on" >/dev/null && exit $rc' ERR
+                fi
 
                 # If `before` wasn't redefined, then this is `:`.
                 before