summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-11-17 19:35:44 -0500
committerSimo Sorce <simo@redhat.com>2014-11-18 15:24:31 -0500
commita86d8e80645291b567c9cdb3bfe8d57ff4ddccf0 (patch)
tree832097d314e150fcda78bb2e464d8da7a7d9bfd8
parent7c176b708eb855ea8774ad36ba72fd31952a8895 (diff)
downloadfreeipa-a86d8e80645291b567c9cdb3bfe8d57ff4ddccf0.tar.gz
freeipa-a86d8e80645291b567c9cdb3bfe8d57ff4ddccf0.tar.xz
freeipa-a86d8e80645291b567c9cdb3bfe8d57ff4ddccf0.zip
Add UTC date to GIT snapshot version generation
This way make rpms will always generate new packages that can be installed on top fo older ones, regardless of alphabetic ordering of the GIT commit id. Also make sure version and date variables are immditely resolved, so they can't change during the build. Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index eca282a23..d714aad81 100644
--- a/Makefile
+++ b/Makefile
@@ -16,9 +16,10 @@ IPA_NUM_VERSION ?= $(shell printf %d%02d%02d $(IPA_VERSION_MAJOR) $(IPA_VERSION_
# target.
ifeq ($(IPA_VERSION_IS_GIT_SNAPSHOT),"yes")
-GIT_VERSION=$(shell git show --pretty=format:"%h" --stat HEAD 2>/dev/null|head -1)
+DATESTR:=$(shell date -u +'%Y%m%d%H%M')
+GIT_VERSION:=$(shell git show --pretty=format:"%h" --stat HEAD 2>/dev/null|head -1)
ifneq ($(GIT_VERSION),)
-IPA_VERSION=$(IPA_VERSION_MAJOR).$(IPA_VERSION_MINOR).$(IPA_VERSION_RELEASE)GIT$(GIT_VERSION)
+IPA_VERSION=$(IPA_VERSION_MAJOR).$(IPA_VERSION_MINOR).$(IPA_VERSION_RELEASE).$(DATESTR)GIT$(GIT_VERSION)
endif # in a git tree and git returned a version
endif # git