dahdi-linux/build_tools/make_version
Shaun Ruffell 7ca082887a build_tools/make_version: Remove support for subversion working copies.
It has now been years since subversion has been used with this project. We can
go ahead and simplify the version script now.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-05-13 14:45:01 -05:00

22 lines
593 B
Bash
Executable File

#!/bin/sh
if [ -f ${1}/.version ]; then
cat ${1}/.version
elif [ -d ${1}/.git ]; then
VERSION=`git describe --tags --dirty=M 2> /dev/null | sed -e "s/^v\([0-9]\)/\1/"`
if [ $? -ne 0 ]; then
MODIFIED=""
if [ "`git ls-files -m | wc -l`" != "0" ]; then
MODIFIED="M"
fi
# Some older versions of git do not support all the above
# options.
VERSION=GIT-`git rev-parse --short --verify HEAD`${MODIFIED}
fi
echo ${VERSION}
else
# Use the directory information in the absence of any other version
# information
pwd -P
fi