From 4676ad6671c7182c9b556dc3174529153d97b1dd Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 21 Oct 2015 12:08:41 +0300 Subject: [PATCH] make_version: cut off slashes in git If we are based on a git tag with a name (such as 'upstream/2.10.2'), remove everything up to the slash. While we're at it, remove a leading '1%' that gets into the version string as part of the version tag (a Debian version with an epoch: '1:' is converted to '1%'). Signed-off-by: Tzafrir Cohen Acked-by: Russ Meyerriecks --- build_tools/make_version | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build_tools/make_version b/build_tools/make_version index 319842b..5bee529 100755 --- a/build_tools/make_version +++ b/build_tools/make_version @@ -68,6 +68,8 @@ elif [ -d ${1}/.git ]; then # options. VERSION=GIT-`git rev-parse --short --verify HEAD`${MODIFIED} fi + VERSION=${VERSION##*/} # Remove leading slashes: upsteram/2.10.2 + VERSION=${VERSION#[1-9]%} # Remove 1% from tag (tag from Debian epoch) echo ${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'`