diff options
author | Jan Darmochwal | 2010-10-08 13:31:47 +0200 |
---|---|---|
committer | Jan Darmochwal | 2010-10-08 13:31:47 +0200 |
commit | 0b586a50b0e95e2b8d102f59a97119a1a2964bc0 (patch) | |
tree | fe533c369e71dfecca3c3320ee2ae624e7a99bc0 | |
parent | Sort Sessions (diff) | |
download | vmchooser-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-x | build.sh | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -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 ]] |