summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Darmochwal2010-10-08 13:31:47 +0200
committerJan Darmochwal2010-10-08 13:31:47 +0200
commit0b586a50b0e95e2b8d102f59a97119a1a2964bc0 (patch)
treefe533c369e71dfecca3c3320ee2ae624e7a99bc0
parentSort Sessions (diff)
downloadvmchooser-0b586a50b0e95e2b8d102f59a97119a1a2964bc0.tar.gz
vmchooser-0b586a50b0e95e2b8d102f59a97119a1a2964bc0.tar.xz
vmchooser-0b586a50b0e95e2b8d102f59a97119a1a2964bc0.zip
Fix for bugs in build.sh
* don't remove BUILDDIR when called with --clean from wrong directory * set SCRIPTNAME before displaying it
-rwxr-xr-xbuild.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/build.sh b/build.sh
index 7a515e4..fdd8b44 100755
--- a/build.sh
+++ b/build.sh
@@ -8,6 +8,15 @@ BUILDDIR="build"
DIR=$(pwd)
+SCRIPTNAME=$(basename "$0" 2>/dev/null || echo "$0")
+
+if [[ ! -f "$DIR"/"$SRCDIR"/CMakeLists.txt ]]
+then
+ echo "$SRCDIR/CMakeLists.txt not found" >&2
+ echo "please run '$SCRIPTNAME' from its containing directory" >&2
+ exit 1
+fi
+
for OPTION in "$@"
do
if [[ "$OPTION" == "--clean" ]]
@@ -22,14 +31,6 @@ do
fi
done
-if [[ ! -f "$DIR"/"$SRCDIR"/CMakeLists.txt ]]
-then
- echo "$SRCDIR/CMakeLists.txt not found" >&2
- SCRIPTNAME=$(basename "$0" 2>/dev/null || echo "$0")
- echo "please run '$SCRIPTNAME' from its containing directory" >&2
- exit 1
-fi
-
# note: NCORES may be too large on systems with hyperthreading
NCORES=$(grep -c "^processor" /proc/cpuinfo 2>/dev/null)
if [[ ! $NCORES -ge 1 ]]