summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Cottlehuber <dch@skunkwerks.at>2018-05-02 08:13:33 +0000
committerJan Lehnardt <jan@apache.org>2018-07-14 12:37:32 +0200
commit768e9ebb9c53afcd0da3301841e945b54d0a3b49 (patch)
treec2c943178eae8d3a30a5d1c5541dfd572f78cfb7
parent4ea7210631fb1515fe5a306988af046fe4aff2af (diff)
downloadcouchdb-768e9ebb9c53afcd0da3301841e945b54d0a3b49.tar.gz
build: ease pattern matching to be less pedantic about RC
git-describe may have changed output formats. The previous regex doesn't allow any trailing content, and git-describe always appends -g<SHA> unless abbrev=0 is added. This approach pulls out only the matching tag, leaving behind any trailing garbage from git-describe, and as a bonus allows tagging a commit from within a branch, and running a release directly from the branch without needing to re-check out the tag itself.
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1e0ea8224..727872fbd 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ IN_RELEASE = $(shell if [ ! -d .git ]; then echo true; fi)
ifeq ($(IN_RELEASE), true)
COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)
else
-RELTAG = $(shell git describe | grep -E '^[0-9]+\.[0-9]\.[0-9]+(-RC[0-9]+)?$$')
+RELTAG = $(shell git describe --dirty --abbrev=0 --tags --always --first-parent | grep -Eo '^[0-9]+\.[0-9]\.[0-9]+(-RC[0-9]+)?')
ifeq ($(RELTAG),)
COUCHDB_VERSION_SUFFIX = $(shell git rev-parse --short --verify HEAD)
COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)-$(COUCHDB_VERSION_SUFFIX)