From 963ffbb7f918560370df458ce0e3a4806c48beaa Mon Sep 17 00:00:00 2001 From: Thorsten von Eicken Date: Mon, 12 Dec 2016 23:04:43 -0800 Subject: [PATCH] try #2 to fix versioning in Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3445121f..15bd1289 100644 --- a/Makefile +++ b/Makefile @@ -189,10 +189,10 @@ endif TRAVIS_BRANCH?=$(shell git symbolic-ref --short HEAD --quiet) # Use git describe to get the latest version tag, commits since then, sha and dirty flag, this # results is something like "v1.2.0-13-ab6cedf-dirty" -VERSION := $(shell (git describe --tags --match 'v*' --long --dirty || echo "no-tag") | sed -re 's/(v[0-9]*\.[0-9]*)\.[0-9]*-/\1./') +VERSION := $(shell (git describe --tags --match 'v*' --long --dirty || echo "no-tag") | sed -re 's/(\.0)?-/./') # If not on master then insert the branch name ifneq ($(TRAVIS_BRANCH),master) -ifneq ($(TRAVIS_BRANCH),$(patsubst -*,,$(VERSION))) +ifneq ($(findstring V%,$(TRAVIS_BRANCH)),) VERSION := $(shell echo $(VERSION) | sed -e 's/-/-$(TRAVIS_BRANCH)-/') endif endif