From 33d52dbc43e772ce12d0bba4038c19f872a5e0c7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 22 Oct 2006 22:16:37 +0200 Subject: [PATCH] * Makefile.maint: Complete the adaptation to function with a working directory that is using git (rather than cvs) for version control. --- ChangeLog | 5 +++++ Makefile.maint | 47 ++++++++++++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 048a25f51..b952f5d5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-10-22 Jim Meyering + + * Makefile.maint: Complete the adaptation to function with a working + directory that is using git (rather than cvs) for version control. + 2006-10-22 Ralf Wildenhues * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'. diff --git a/Makefile.maint b/Makefile.maint index 4bf296c05..101a1c0fc 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -30,6 +30,8 @@ gzip_rsyncable := \ GZIP_ENV = '--no-name --best $(gzip_rsyncable)' CVS = cvs +GIT = git +VC = $(GIT) CVS_LIST = build-aux/vc-list-files @@ -45,7 +47,7 @@ VERSION_REGEXP = $(subst .,\.,$(VERSION)) tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]') tag-this-version = $(subst .,_,$(VERSION)) -this-cvs-tag = $(tag-package)-$(tag-this-version) +this-vc-tag = $(tag-package)-$(tag-this-version) my_distdir = $(PACKAGE)-$(VERSION) # Old releases are stored here. @@ -449,24 +451,32 @@ copyright-check: fi -# Sanity checks with the CVS repository. -cvs-tag-check: - echo $(this-cvs-tag); \ - if $(CVS) -n log -h README | grep -e $(this-cvs-tag): >/dev/null; then \ - echo "$(this-cvs-tag) as already been used; not tagging" 1>&2; \ - exit 1; \ - else :; fi +# Sanity checks with the repository. +# Abort early if this tag has already been used. +vc-tag-check: + used=no; \ + if $(VC) --help | grep CVS; then \ + $(CVS) -n log -h README|grep -e $(this-vc-tag): >/dev/null \ + && used=yes; \ + else \ + $(GIT) tag -l '^$(this-vc-tag)$$' && used=yes; \ + fi; \ + if test "$$used" = yes; then \ + echo "$(this-vc-tag) has already been used; not tagging" 1>&2; \ + exit 1; \ + fi -cvs-diff-check: - if $(CVS) diff >cvs-diffs; then \ - rm cvs-diffs; \ - else \ +vc-diff-check: + $(VC) diff > vc-diffs || : + if test -s vc-diffs; then \ + cat vc-diffs; \ echo "Some files are locally modified:" 1>&2; \ - cat cvs-diffs; \ exit 1; \ + else \ + rm vc-diffs; \ fi -cvs-check: cvs-diff-check cvs-tag-check +cvs-check: vc-diff-check vc-tag-check maintainer-distcheck: $(MAKE) distcheck @@ -476,9 +486,8 @@ maintainer-distcheck: # Tag before making distribution. Also, don't make a distribution if # checks fail. Also, make sure the NEWS file is up-to-date. # FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck. -cvs-dist: $(local-check) cvs-check maintainer-distcheck - $(CVS) update po - $(CVS) tag -c $(this-cvs-tag) +vc-dist: $(local-check) cvs-check maintainer-distcheck + $(VC) tag $(this-vc-tag) $(MAKE) dist # Use this to make sure we don't run these programs when building @@ -575,11 +584,11 @@ alpha beta major: news-date-check changelog-check $(local-check) && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \ || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\ || : - $(MAKE) cvs-dist + $(MAKE) vc-dist $(MAKE) $(xd-delta) $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir) ln $(rel-files) $(release_archive_dir) chmod a-w $(rel-files) $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@ echo $(VERSION) > $(prev_version_file) - $(CVS) ci -m. $(prev_version_file) + $(VC) commit -m. $(prev_version_file) -- 2.34.1