summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-04-14 08:56:06 +0300
committerTimo Teras <timo.teras@iki.fi>2009-04-14 08:56:06 +0300
commitf4210298adf0950c5ee41d8cc7026db7ba8b1821 (patch)
tree0c191fd543c4007706b2c6ac979b4305f620fdeb
parent355626171daee1c5b57b078baf769946234c62a7 (diff)
downloadapk-tools-f4210298adf0950c5ee41d8cc7026db7ba8b1821.tar.gz
apk-tools-f4210298adf0950c5ee41d8cc7026db7ba8b1821.tar.bz2
apk-tools-f4210298adf0950c5ee41d8cc7026db7ba8b1821.tar.xz
apk-tools-f4210298adf0950c5ee41d8cc7026db7ba8b1821.zip
build: use version from git describe if available
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index bf16a44..d656c34 100644
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,13 @@
PACKAGE := apk-tools
VERSION := 2.0_pre10
-SVN_REV := $(shell svn info 2> /dev/null | grep ^Revision | cut -d ' ' -f 2)
-ifneq ($(SVN_REV),)
-FULL_VERSION := $(VERSION)-r$(SVN_REV)
+GIT_REV := $(shell git describe || echo exported)
+ifneq ($(GIT_REV), exported)
+ifneq ($(filter apk-tools-$(VERSION)%, $(GIT_REV)),)
+FULL_VERSION := $(patsubst apk-tools-%,%,$(GIT_REV))
+else
+FULL_VERSION := $(GIT_REV)
+endif
else
FULL_VERSION := $(VERSION)
endif