From e8f31e1b353299d13720e76b3fe53c0a7aea0fa0 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Sat, 21 Jun 2008 20:14:04 +0200 Subject: New 'tag' target --- Makefile.am | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6a0787c..f589cc8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,19 +41,30 @@ GIT = git tag: test -d "$(top_srcdir)/.git" @cd "$(top_srcdir)" && $(GIT) status;: - @cd "$(top_srcdir)" && $(GIT) diff-files --quiet - @cd "$(top_srcdir)" && $(GIT) diff-index --cached --quiet HEAD - test "x$$($(SED) '/^$(PACKAGE_TARNAME) $(PACKAGE_VERSION)$$/,$$ d' '$(top_srcdir)/NEWS')" = "x" - @$(SED) -n '/^$(PACKAGE_TARNAME) $(PACKAGE_VERSION)$$/,/^$(PACKAGE_TARNAME) / p' '$(top_srcdir)/NEWS' \ + @cd "$(top_srcdir)" && if $(GIT) diff-files --quiet; then :; else \ + echo "Uncommitted local changes detected."; \ + exit 1; fi + @cd "$(top_srcdir)" && if $(GIT) diff-index --cached --quiet HEAD; then :; else \ + echo "Uncommitted cached changes detected."; \ + exit 1; fi + @test "x$(TAG)" = "x" && { \ + echo "TAG not defined. Try 'make tag TAG=2.11' or something similar."; \ + exit 1; } + @test "x$$(echo "$(TAG)" | $(SED) 's/^[0-9]\{1,\}\.[0-9]\{1,\}//')" = "x" || { \ + echo "TAG=$(TAG) is not in numerical 'x.y' format."; \ + exit 1; } + @test "x$$($(SED) '1p' '$(top_srcdir)/NEWS')" = "x$(PACKAGE_TARNAME) $(TAG)" || { \ + echo "NEWS does not start with entry for '$(PACKAGE_TARNAME) $(TAG)'"; \ + exit 1; } + @$(SED) -n '1p; 2,/^$(PACKAGE_TARNAME) / p' '$(top_srcdir)/NEWS' \ | $(SED) '$$d' | $(SED) '$$ { /^$$/d }' \ > TAG-MESSAGE @cat TAG-MESSAGE - @echo "Do you really want to tag this as rel-$(PACKAGE_VERSION)? Enter to continue, Ctrl-C to abort." - @msg="$$PWD/TAG-MESSAGE"; \ - trap "rm $$msg" TERM QUIT ABRT INT; read ignore_this; \ - args=""; \ - test "x$$(echo "$(PACKAGE_VERSION)" | $(SED) 's/^[0-9]\{1,\}\.[0-9]\{1,\}//')" = "x" && args="-s -F $$msg"; \ - cd "$(top_srcdir)" && $(GIT) tag $${args} "v$(PACKAGE_VERSION)"; rm "$$msg" + @echo "Do you really want to tag this as release 'v$(TAG))? Enter to continue, Ctrl-C to abort." + @msgfile="$$PWD/TAG-MESSAGE"; \ + trap "rm $$msgfile" TERM QUIT ABRT INT; read ignore_this; \ + cd "$(top_srcdir)" && $(GIT) tag -s -F "$$msgfile" "v$(TAG)"; \ + rm "$$msgfile" UPLOAD_DIR = upload-dir ALL_UPLOAD_FILES = $(UPLOAD_FILES) $(distdir).tar.bz2 -- cgit