Merge "build_tools/make_version: Update version parsing for Git migration" into 11

changes/88/88/1
Matt Jordan 12 years ago committed by Gerrit Code Review
commit 736a3cef01

@ -1,5 +1,7 @@
#!/bin/sh
MAINLINE_BRANCH=11
if [ -f ${1}/.version ]; then
cat ${1}/.version
elif [ -d ${1}/.svn ]; then
@ -94,16 +96,16 @@ elif [ -d ${1}/.git ]; then
MODIFIED=""
SVN_REV=`${GIT} log --pretty=full -1 | grep -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
if [ -z "$SVN_REV" ]; then
VERSION=GIT-`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`
VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`
if [ $? -ne 0 ]; then
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}
VERSION=`${GIT} rev-parse --short --verify HEAD`${MODIFIED}
fi
echo ${VERSION}
echo GIT-${MAINLINE_BRANCH}-${VERSION}
else
PARTS=`LANG=C ${GIT} log --pretty=full | grep -F "git-svn-id:" | head -1 | awk '{print $2;}' | sed -e s:^.*/svn/$2/:: | sed -e 's:/: :g' | sed -e 's/@.*$//g'`
BRANCH=0

Loading…
Cancel
Save