Cleanup scmversion script, fix --save-scmversion option
authorMarek Marczykowski <marmarek@invisiblethingslab.com>
Mon, 13 May 2013 18:23:54 +0000 (20:23 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 17 Jul 2013 09:42:42 +0000 (10:42 +0100)
Remove unused variable, fix erroneously removed --save-scmversion code.

Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
xen/tools/scmversion

index 219d898803eb0075987f696f11af5a7258806345..b0c3b952f61dddf034ac0b0fd0a7662f638bf015 100755 (executable)
@@ -16,10 +16,10 @@ usage() {
        exit 1
 }
 
-scm_only=false
+save_scm=false
 srctree=.
 if test "$1" = "--save-scmversion"; then
-       scm_only=true
+       save_scm=true
        shift
 fi
 if test $# -gt 0; then
@@ -32,17 +32,10 @@ fi
 
 scm_version()
 {
-       local short
-       short=false
-
-       cd "$srctree"
        if test -e .scmversion; then
                cat .scmversion
                return
        fi
-       if test "$1" = "--short"; then
-               short=true
-       fi
 
        # Check for git and a git repo.
        if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
@@ -98,4 +91,8 @@ cd $srctree
 # full scm version string
 res="$(scm_version)"
 
+if [ "$save_scm" = "true" ]; then
+    echo $res > .scmversion
+fi
+
 echo "$res"