summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-04-22 10:45:21 +0200
committerJim Meyering <meyering@redhat.com>2008-04-22 10:45:21 +0200
commit68466d44b1ff35383271930c12186b3d2fd53976 (patch)
tree8d15503a192fa85cf82e299a9dc059abe5bf698f
parent79a98d9bc1ee67dadc8df376d336c4f1270c464d (diff)
downloadcoreutils-68466d44b1ff35383271930c12186b3d2fd53976.tar.xz
guard against inserting a NEWS entry into a block for a prior release
Without a guard like this, it is far too easy to apply a patch prepared against a preceding release, and not notice that a NEWS entry is inserted into the wrong block. * maint.mk (sc_immutable_NEWS): New rule. (update-NEWS-hash): New rule to update the hard-coded hash.
-rw-r--r--maint.mk17
1 files changed, 17 insertions, 0 deletions
diff --git a/maint.mk b/maint.mk
index 46bc8b613..e2a8e1cd9 100644
--- a/maint.mk
+++ b/maint.mk
@@ -42,6 +42,7 @@ endif
PREV_VERSION := $(shell cat $(prev_version_file))
VERSION_REGEXP = $(subst .,\.,$(VERSION))
+PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
ifeq ($(VC),$(GIT))
this-vc-tag = v$(VERSION)
@@ -425,6 +426,22 @@ sc_perl_coreutils_test:
exit 1; } || :; \
fi
+NEWS_hash = \
+ $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
+ $(srcdir)/NEWS | md5sum -)
+
+# Ensure that we don't accidentally insert an entry into an old NEWS block.
+old_NEWS_hash = c58d611d93d218181ed77f81ff2395ff -
+sc_immutable_NEWS:
+ @if test -f $(srcdir)/NEWS; then \
+ test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \
+ { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \
+ fi
+
+# Update the hash stored above. Do this after each release.
+update-NEWS-hash: NEWS
+ perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" $(ME)
+
# Ensure that the c99-to-c89 patch applies cleanly.
patch-check:
rm -rf src-c89 $@.1 $@.2