]> Cypherpunks repositories - gostls13.git/commitdiff
set -e does not apply to ( ) blocks,
authorRuss Cox <rsc@golang.org>
Mon, 22 Jun 2009 22:43:50 +0000 (15:43 -0700)
committerRuss Cox <rsc@golang.org>
Mon, 22 Jun 2009 22:43:50 +0000 (15:43 -0700)
so implement the check manually.
sigh.

R=r
DELTA=17  (6 added, 0 deleted, 11 changed)
OCL=30606
CL=30612

src/make.bash

index 6b103c657127db604fc47a63467f851bef00537b..00cc6b4fd3e63a3016f4b77fbc51de5ea212ec2b 100755 (executable)
@@ -19,17 +19,23 @@ cp quietgcc.bash $HOME/bin/quietgcc
 chmod +x $HOME/bin/quietgcc
 
 for i in lib9 libbio libmach_amd64 libregexp cmd pkg cmd/gobuild cmd/godoc cmd/gofmt
-do (
-       echo; echo; echo %%%% making $i %%%%; echo
-       cd $i
-       case $i in
-       cmd)
-               bash make.bash
-               ;;
-       *)
-               make install
-       esac
-) done
+do
+       # The ( ) here are to preserve the current directory
+       # for the next round despite the cd $i below.
+       # set -e does not apply to ( ) so we must explicitly
+       # test the exit status.
+       (
+               echo; echo; echo %%%% making $i %%%%; echo
+               cd $i
+               case $i in
+               cmd)
+                       bash make.bash
+                       ;;
+               *)
+                       make install
+               esac
+       )  || exit 1
+done
 
 case "`uname`" in
 Darwin)