From ea719f5b5a1a3872d07377b64d6e1b7c40a3a839 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sat, 5 Jan 2019 21:53:59 +0100 Subject: [PATCH] build: use 'git describe --always' to determine ZREPL_VERSION --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6036caa..343af9b 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ifdef ZREPL_VERSION _ZREPL_VERSION := $(ZREPL_VERSION) endif ifndef _ZREPL_VERSION - _ZREPL_VERSION := $(shell git describe --dirty 2>/dev/null || echo "ZREPL_BUILD_INVALID_VERSION" ) + _ZREPL_VERSION := $(shell git describe --always --dirty 2>/dev/null || echo "ZREPL_BUILD_INVALID_VERSION" ) ifeq ($(_ZREPL_VERSION),ZREPL_BUILD_INVALID_VERSION) # can't use .SHELLSTATUS because Debian Stretch is still on gmake 4.1 $(error cannot infer variable ZREPL_VERSION using git and variable is not overriden by make invocation) endif @@ -83,7 +83,7 @@ release: $(RELEASE_BINS) $(RELEASE_NOARCH) cp $^ "$(ARTIFACTDIR)/release" cd "$(ARTIFACTDIR)/release" && sha512sum $$(ls | sort) > sha512sum.txt @# note that we use ZREPL_VERSION and not _ZREPL_VERSION because we want to detect the override - @if git describe --dirty 2>/dev/null | grep dirty >/dev/null; then \ + @if git describe --always --dirty 2>/dev/null | grep dirty >/dev/null; then \ echo '[INFO] either git reports checkout is dirty or git is not installed or this is not a git checkout'; \ if [ "$(ZREPL_VERSION)" = "" ]; then \ echo '[WARN] git checkout is dirty and make variable ZREPL_VERSION was not used to override'; \