From: Marek Marczykowski Date: Mon, 13 May 2013 18:23:54 +0000 (+0200) Subject: Cleanup scmversion script, fix --save-scmversion option X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6627 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=26b48cf251c6ce39c07462b833d33195c172466b;p=xen.git Cleanup scmversion script, fix --save-scmversion option Remove unused variable, fix erroneously removed --save-scmversion code. Signed-off-by: Marek Marczykowski --- diff --git a/xen/tools/scmversion b/xen/tools/scmversion index 219d898803..b0c3b952f6 100755 --- a/xen/tools/scmversion +++ b/xen/tools/scmversion @@ -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"