From d8ebef3f5afa40c90d4919b82c38067933d617aa Mon Sep 17 00:00:00 2001 From: j8takagi Date: Tue, 3 Jun 2014 23:51:43 +0900 Subject: [PATCH] =?utf8?q?make=20gittag=E3=81=AE=E5=8B=95=E4=BD=9C?= =?utf8?q?=E3=82=92=E5=A4=89=E6=9B=B4=E3=80=82VERSION=E3=81=AB=E8=A8=98?= =?utf8?q?=E8=BC=89=E3=81=95=E3=82=8C=E3=81=9F=E3=82=BF=E3=82=B0=E3=81=8Cm?= =?utf8?q?aster=E4=BB=A5=E5=A4=96=E3=81=AEgit=20REF=E3=81=AE=E5=A0=B4?= =?utf8?q?=E5=90=88=E3=80=81=E3=82=BF=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Makefile | 10 +++++----- VERSION | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 2cc1f04..8bd9f1a 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,10 @@ prefix ?= ~ bindir ?= $(prefix)/bin VERSION := $(shell $(CAT) VERSION) -VER := $(shell $(ECHO) $(VERSION) | $(SED) -e 's/^v\([0-9.]*\)p\([0-9]*\)/\1/') -PATCH := $(shell $(ECHO) $(VERSION) | $(SED) -e 's/^v[0-9.]*p\([0-9]*\)/\1/') + +VERSIONGITREF := $(shell $(GIT) show-ref -s --tags $(VERSION)) + +MASTERGITREF := $(shell $(GIT) show-ref -s refs/heads/master) VERSIONFILES = include/package.h \ test/system/casl2/opt_v/0.txt \ @@ -71,9 +73,7 @@ $(VERSIONFILES): VERSION @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@ gittag: - patch=$(PATCH); while ($(GIT) tag | $(GREP) v$(VER)p$${patch}); do patch=`$(EXPR) $${patch} + 1`; done; $(ECHO) v$(VER)p$${patch} >VERSION - if ($(GIT) status -s | $(GREP) VERSION); then $(GIT) add VERSION; $(GIT) commit --amend --no-edit; fi - $(CAT) VERSION | $(XARGS) $(GIT) tag + if test `$(GIT) status -s | wc -l` -gt 0; then $(ECHO) "Error: commit, first."; exit 1; fi; if test "$(VERSIONGITREF)" != "$(MASTERGITREF)"; then $(GIT) tag $(VERSION); fi distclean: cmd-clean src-distclean gtags-clean version-clean clean diff --git a/VERSION b/VERSION index c9f9728..2a11d4d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.2p29 +v0.2p31 -- 2.18.0