diff options
author | Matt Jordan <mjordan@digium.com> | 2015-04-13 12:03:46 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-04-13 12:03:46 -0500 |
commit | 974d44fd8922ae77462bbdf8e598f03de13b888f (patch) | |
tree | 69c166c2291da63de27d971a7899fb24a7f2d886 | |
parent | 755563f0f3c178c06cc4878b61463829cddbbbfb (diff) | |
parent | 3f9aa29945d0eb2fd91f1c0f03b6c9409d86e0d1 (diff) |
Merge "build_tools/make_version: Update version parsing for Git migration"
-rwxr-xr-x | build_tools/make_version | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/build_tools/make_version b/build_tools/make_version index d11c096eb..fd14a550a 100755 --- a/build_tools/make_version +++ b/build_tools/make_version @@ -3,6 +3,7 @@ AWK=${AWK:-awk} GIT=${GIT:-git} GREP=${GREP:-grep} +MAINLINE_BRANCH=master if [ -f ${1}/.version ]; then cat ${1}/.version @@ -98,16 +99,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 |