[PATCH 1/2] Simplify vesion extraction and correct some bugglet.
Cristian Ionescu-Idbohrn
cristian.ionescu-idbohrn at axis.com
Sat Feb 16 08:30:09 PST 2013
AFAIU, what you want is to edit a string like 'v2.1-636-gc12ef0ce3eef'
and strip off both the 'v' prefix and 'everything after the first dash'
suffix, then add some zeroes. The sed regexps don't do that got me. And
they are overly convoluted. I get:
PRODVERSION_STRING=2.1.636.0
CFBUNDLEVERSION_STRING=2.1.636
This patch simplifies that and reuses code. Result:
VERSION_STRING='v2.1-637-gd0b2b6a515b8'
CFBUNDLEVERSION_STRING='2.1.0'
PRODVERSION_STRING='2.1.0.0'
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn at axis.com>
---
Makefile | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 43ab19a..50939c9 100644
--- a/Makefile
+++ b/Makefile
@@ -27,10 +27,11 @@ XSLTFILES = xslt/*.xslt
UNAME := $(shell $(CC) -dumpmachine 2>&1 | grep -E -o "linux|darwin|win")
VERSION_STRING := $(shell git describe --tags --abbrev=12 || echo "v$(VERSION)")
-# Windows .nsi style with four numbers 1.2.3.4
-PRODVERSION_STRING := $(shell git describe --tags --abbrev=12 | sed 's/v\([0-9]*\)\.\([0-9]*\)-\([0-9]*\)-.*/\1.\2.\3.0/ ; s/v\([0-9]\)\.\([0-9]*\)/\1.\2.0.0/' || echo "$(VERSION).0.0")
# Mac Info.plist style with three numbers 1.2.3
-CFBUNDLEVERSION_STRING := $(shell git describe --tags --abbrev=12 | sed 's/v\([0-9]*\)\.\([0-9]*\)-\([0-9]*\)-.*/\1.\2.\3/ ; s/v\([0-9]\)\.\([0-9]*\)/\1.\2.0/' || echo "$(VERSION).0")
+CFBUNDLEVERSION_STRING := $(shell git describe --tags --abbrev=12 | \
+ sed 's/^v\([^-]\+\)-.*/\1.0/' || echo "$(VERSION).0")
+# Windows .nsi style with four numbers 1.2.3.4
+PRODVERSION_STRING := $(CFBUNDLEVERSION_STRING).0
# find libdivecomputer
# First deal with the cross compile environment and with Mac.
--
1.7.10.4
More information about the subsurface
mailing list