Remove unused variable, fix erroneously removed --save-scmversion code.
Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
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
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
# full scm version string
res="$(scm_version)"
+if [ "$save_scm" = "true" ]; then
+ echo $res > .scmversion
+fi
+
echo "$res"