Skip to content

Commit

Permalink
Fix version info when built without git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
gentoo90 committed Jul 18, 2015
1 parent a10897c commit c698982
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c698982

Please sign in to comment.