aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xxen/tools/scmversion15
1 files changed, 6 insertions, 9 deletions
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"