From c6989822a2e22f8a706b1cdd113620702d11bc81 Mon Sep 17 00:00:00 2001 From: gentoo90 Date: Sat, 18 Jul 2015 16:36:44 +0300 Subject: [PATCH] Fix version info when built without git repo --- Makefile.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 523f746e7be..718099145d4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -17,10 +17,15 @@ else CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL) CFG_PACKAGE_VERS=$(CFG_RELEASE) endif +CFG_BUILD_DATE = $(shell date +%F) + +ifeq ($(wildcard .git),) +CFG_VERSION = $(CFG_RELEASE) (built $(CFG_BUILD_DATE)) +else CFG_VER_DATE = $(shell git log -1 --date=short --pretty=format:'%cd') CFG_VER_HASH = $(shell git rev-parse --short HEAD) -CFG_BUILD_DATE = $(shell date +%F) CFG_VERSION = $(CFG_RELEASE) ($(CFG_VER_HASH) $(CFG_VER_DATE)) (built $(CFG_BUILD_DATE)) +endif PKG_NAME = cargo-$(CFG_PACKAGE_VERS) ifdef CFG_DISABLE_VERIFY_INSTALL