summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-11-07 21:29:48 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-11-07 21:29:48 -0800
commite448e4c70712103eacb00862ced17379ba764640 (patch)
treef741f840b35eff337ec8825f7189eff633b68924
parent6315be3785724e1f2b0b28150c0ba0d293696634 (diff)
downloadnasmbuild-e448e4c70712103eacb00862ced17379ba764640.tar.gz
nasmbuild-e448e4c70712103eacb00862ced17379ba764640.tar.xz
nasmbuild-e448e4c70712103eacb00862ced17379ba764640.zip
Making -e work inside a shell function but trapping the result is apparently really
hard, since the -e-suppressing behavior of just about anything "spills over". Thus, do it the brute-force way by disabling it in the main shell temporarily.
-rwxr-xr-xbuildall.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/buildall.sh b/buildall.sh
index 59832d1..90796e3 100755
--- a/buildall.sh
+++ b/buildall.sh
@@ -23,9 +23,6 @@ if [ `whoami` != nasmbuild ]; then
fi
build () {
- # -e is dropped for subshells?
- set -xe
-
version="$1"
outdir="$2"
gitdir="$3"
@@ -193,7 +190,12 @@ fi
git clone -s -l -n git git-rel
( cd git-rel && git checkout "$tag" )
tagref=$(cd git-rel && git rev-parse "$tag")
- if ( build "$rel_version" "$reldir"/"$rel_version" git-rel "$tagref" ); then
+ # Note: "if ( shellfunc ... ); then" breaks -e... thus this workaround.
+ set +e
+ ( set -e; build "$rel_version" "$reldir"/"$rel_version" git-rel "$tagref" )
+ err=$?
+ set -e
+ if [ $err -eq 0 ]; then
process_release "$rel_version"
else
# Build failed, we don't want to build this exact tag again
@@ -217,7 +219,11 @@ if [ -d "$snapdir"/$today ]; then
fi
snap_version=$(cat git/version)-$today
-if ( build "$snap_version" "$snapdir"/$today git "$HEAD" ); then
+set +e
+( set -e; build "$snap_version" "$snapdir"/$today git "$HEAD" )
+err=$?
+set -e
+if [ $err -eq 0 ]; then
env GIT_DIR="$tagrepo" git tag -a -f -m "Daily snapshot $today" nasm-"$snap_version"
env GIT_DIR="$tagrepo" git update-server-info
( cd $snapdir && rm -f latest && ln -s $today latest )