From 444f80134fd42f22561096b4a1a1779d73507115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20K=C3=BCttler?= Date: Wed, 28 Jan 2015 22:43:55 +0100 Subject: [PATCH] Add "install" argument to update script --- update.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/update.sh b/update.sh index b03fdfa076..51fb70cde2 100755 --- a/update.sh +++ b/update.sh @@ -47,8 +47,12 @@ function handleCmdLine() { (--tag=*) tag="`echo $arg | sed 's/[-a-zA-Z0-9]*=//'`" ;; + (install) + install="yes" + ;; (*) - echo "Error: $arg not recognized." >&2exit 1 + echo "Error: $arg not recognized." >&2 + exit 1 ;; esac done @@ -170,11 +174,13 @@ function makeWorld() { ) # Update the running dmd version - local old=$(which dmd) - if [ -f "$old" ]; then - echo "Copying "$wd/dmd/src/dmd" over $old" - [ ! -w "$old" ] && local sudo="sudo" - $sudo cp "$wd/dmd/src/dmd" "$old" + if [[ ! -z $install ]]; then + local old=$(which dmd) + if [ -f "$old" ]; then + echo "Copying "$wd/dmd/src/dmd" over $old" + [ ! -w "$old" ] && local sudo="sudo" + $sudo cp "$wd/dmd/src/dmd" "$old" + fi fi # Then make druntime @@ -198,7 +204,7 @@ function makeWorld() { } # main -handleCmdLine +handleCmdLine $* confirmChoices installAnew $toInstall update $toUpdate