[beast: 6/41] MISC: adapt versioning to use 0.10.1~rc1+<commitcount>.g<commithash>
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 6/41] MISC: adapt versioning to use 0.10.1~rc1+<commitcount>.g<commithash>
- Date: Fri, 16 Jun 2017 10:23:18 +0000 (UTC)
commit fe97489a3c26ebee5088271586da6338ef652bdc
Author: Tim Janik <timj gnu org>
Date: Fri Jun 9 19:57:59 2017 +0200
MISC: adapt versioning to use 0.10.1~rc1+<commitcount>.g<commithash>
Signed-off-by: Tim Janik <timj gnu org>
misc/mkbuildid.sh | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/misc/mkbuildid.sh b/misc/mkbuildid.sh
index c3bea1a..fe6211d 100755
--- a/misc/mkbuildid.sh
+++ b/misc/mkbuildid.sh
@@ -17,18 +17,16 @@ BUILDID_HH="$2"
DOTGIT=`git rev-parse --git-dir 2>/dev/null` || true
gen_buildid() {
- test -e "$DOTGIT" || # not in a git-tracked source tree
- { printf %s "${FALLBACK_VERSION-0.0.0}-untracked" ; return ; }
+ test -e "$DOTGIT" || # Tarball: lacks git version info
+ { printf %s "${FALLBACK_VERSION-0.0.0}+tarball" ; return ; }
COMMITID="${1-HEAD}"
DESC=$(git describe --match '[0-9]*.*[0-9]' --abbrev=5 $COMMITID)
test "$DESC" != "${DESC%%-*}" || # HEAD is on release tag
- { echo "$DESC" ; return ; }
- # HEAD has commits on top of last release tag, transform 0.0.0-7-gabc -> 0.0.1~7-gabc
- MICRO=$(printf %s "$DESC" | sed 's/^[^-]*\b\([0-9]\+\)-.*/\1/')
- [[ "$MICRO" =~ ^[0-9]+$ ]] || die 7 "failed to detect MICRO in $DESC"
- MICRO=$(expr 1 + "$MICRO")
- NEXT=$(printf %s "$DESC" | sed "s/^\([^-]*\)\b\([0-9]\+\)-/\1$MICRO~wip/")
- printf %s "$NEXT"
+ { echo "$FALLBACK_VERSION" ; return ; }
+ # HEAD has commits on top of last release tag, transform 1.2.3-7-gabc into version postfix
+ GPOSTFIX="${DESC#*-}" # 0.0.0-7-gabc -> 7-gabc
+ GPOSTFIX="+${GPOSTFIX//-/.}" # 7-gabc -> +7.gabc
+ printf %s "$FALLBACK_VERSION$GPOSTFIX"
}
BUILDID=$(gen_buildid HEAD)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]