summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2008-06-21 20:14:04 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2008-07-19 01:45:55 +0200
commite8f31e1b353299d13720e76b3fe53c0a7aea0fa0 (patch)
treeaacbc03169609d944b443e96a6737e041f5c3cf1
parent76214d9332cd602966904543c01af982f0510271 (diff)
downloadndim-git-utils-e8f31e1b353299d13720e76b3fe53c0a7aea0fa0.tar.gz
ndim-git-utils-e8f31e1b353299d13720e76b3fe53c0a7aea0fa0.tar.xz
ndim-git-utils-e8f31e1b353299d13720e76b3fe53c0a7aea0fa0.zip
New 'tag' target
-rw-r--r--Makefile.am31
1 files 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