]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
* Makefile.maint: Complete the adaptation to function with a working
authorJim Meyering <jim@meyering.net>
Sun, 22 Oct 2006 20:16:37 +0000 (22:16 +0200)
committerJim Meyering <jim@meyering.net>
Sun, 22 Oct 2006 20:16:37 +0000 (22:16 +0200)
directory that is using git (rather than cvs) for version control.

ChangeLog
Makefile.maint

index 048a25f51ec4bac29e00a34634ab4666f639f611..b952f5d5fbe5d83afc370f075cf37fe7478f97b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-22  Jim Meyering  <jim@meyering.net>
+
+       * 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  <Ralf.Wildenhues@gmx.de>
 
        * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'.
index 4bf296c05d39e257b6fd916d03e1520909663b67..101a1c0fcc8cd3a5fd4946370df5450bf6bd6d15 100644 (file)
@@ -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)