[PATCH 4/6] build-system: use signed tag to make tar file, if available.

david at tethera.net david at tethera.net
Mon Jul 4 05:03:39 PDT 2011


From: David Bremner <bremner at debian.org>

This as the advantage that "make VERSION=n.m dist" will work correctly
even if the wrong branch happens to be checked out.
---
 Makefile.local |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index b6445e5..d1c0737 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -60,7 +60,13 @@ endif
 endif
 
 $(TAR_FILE):
-	git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD > $(TAR_FILE).tmp
+	if git tag -v $(VERSION) >/dev/null 2>&1; then \
+           ref=$(VERSION); \
+        else \
+           ref="HEAD" ; \
+	   echo "Warning: No signed tag for $(VERSION)"; \
+	fi ; \
+	git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ $$ref > $(TAR_FILE).tmp
 	echo $(VERSION) > version.tmp
 	tar --append -f $(TAR_FILE).tmp --transform s_^_$(PACKAGE)-$(VERSION)/_  --transform 's_.tmp$$__' version.tmp
 	rm version.tmp
-- 
1.7.5.4



More information about the notmuch mailing list