shithub: mc

Download patch

ref: 2b28c30518e4aeb4bfc5592773662b89c58e8663
parent: 87e41be1bc9bffd35472a26076cbb0470f4620ec
author: Ori Bernstein <[email protected]>
date: Mon Sep 4 06:29:41 EDT 2017

Auto-bootstrap on mbld failure.

--- a/mbldwrap.sh
+++ b/mbldwrap.sh
@@ -7,17 +7,23 @@
 	export MYR_MUSE=`pwd`/muse/$O.out
 	export MYR_MC=`pwd`/6/$O.out
 	export MYR_RT=`pwd`/rt/_myrrt.$O
-	BOOT="./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh"
 else
 	export MYR_MUSE=muse
 	export MYR_MC=6m
 	export MYR_RT=`pwd`/rt/_myrrt.o
-	BOOT="./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh"
 fi
+BOOT="./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh"
 
-if [ -f mbld/mbld ] || [ -f obj/mbld/mbld ]; then
-    ./obj/mbld/mbld $@ || ./mbld/mbld $@ || mbld $@ || \
-        (echo "Unable to run mbld $@; have you build successfully"; false)
-else
-    mbld || $BOOT
+MBLD=mbld
+if [ -f obj/mbld/mbld ]; then
+	MBLD=obj/mbld/mbld
+elif [ -f mbld/mbld ]; then
+	MBLD=mbld/mbld
 fi
+
+bootstrap() {
+	($BOOT && mbld/mbld $@) || \
+		(echo "Unable to run mbld $@; have you build successfully"; exit 1)
+}
+
+$MBLD $@ || bootstrap $@