summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Cottlehuber <dch@skunkwerks.at>2018-05-02 08:13:33 +0000
committerDave Cottlehuber <dch@skunkwerks.at>2018-05-02 08:16:12 +0000
commit50af2cb9e38355085a7510d964af4bc6df2433c2 (patch)
treee841662c793df0123e0509f5c7d42ed799c61438
parent369d41bf37585ca72cd0f993e0db9e5fc75f3dfd (diff)
downloadcouchdb-50af2cb9e38355085a7510d964af4bc6df2433c2.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 8168f8085..05b95da4c 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)