[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
maint.mk and NEWS footer
From: |
Eric Blake |
Subject: |
maint.mk and NEWS footer |
Date: |
Wed, 6 Jan 2010 17:08:38 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
I noticed that NEWS_hash in maint.mk doesn't work for m4. Why? Because m4
uses long-hand copyright years, and lists enough years that the
regex '^Copyright.*Free Software' no longer matches. In other words, adding
2010 to the copyright changed the old news hash.
For that matter, NEWS_hash is using 'sed | grep -v'. It seeems like it should
be possible to sanitize the copyright line(s) all within the sed, without
having to use a secondary grep process. But I'm not fluent enough with sed to
quickly write a script that can sanitize both styles into a single recognizable
line:
Copyright (C) 1992, 1993, 1994, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Copyright (C) 2001-2010 Free Software Foundation, Inc.
Meanwhile, with the recent GFDL change [1], the coreutils NEWS hash also ended
up with an alteration, detected by 'make syntax-check' (via
sc_immutable_NEWS). Therefore, how about this patch, which just ignores the
NEWS footer altogether (to be applied before the amended coreutils patch, so
that I'm only updating the coreutils hash once)?
[1] http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/19496
However, if this patch is applied, everyone using maint.mk will need to do a
one-time run of 'make update-NEWS-hash' to update their saved hash the footer
discarded.
Yes, this patch did not use portable spacing of the sed {} command, but anyone
running GNUMakefile probably has a decent sed on their PATH and doesn't have to
obey the portability rule of putting { and } on their own lines.
Comments?
From: Eric Blake <address@hidden>
Date: Wed, 6 Jan 2010 10:03:34 -0700
Subject: [PATCH] maint.mk: ignore entire footer of NEWS file
The old algorithm did not work for projects like m4 that used
long-hand copyright years that wrapped lines. Also, it failed
when upgrading from GFDL 1.2 to GFDL 1.3 in the NEWS footer.
* top/maint.mk (NEWS_hash): Add immunity to multi-line copyright
or GFDL license changes.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 6 ++++++
top/maint.mk | 5 ++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8cf4fae..af711e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-06 Eric Blake <address@hidden>
+
+ maint.mk: ignore entire footer of NEWS file
+ * top/maint.mk (NEWS_hash): Add immunity to multi-line copyright
+ or GFDL license changes.
+
2009-11-17 Eric Blake <address@hidden>
manywarnings: add more warnings
diff --git a/top/maint.mk b/top/maint.mk
index 40f306e..c4353bd 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -548,9 +548,8 @@ sc_const_long_option:
exit 1; } || :
NEWS_hash = \
- $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
- $(srcdir)/NEWS \
- | grep -v '^Copyright .*Free Software' \
+ $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,/^Copyright/ { \
+ /^Copyright/d; p }' $(srcdir)/NEWS \
| md5sum -
\
| sed 's/ .*//')
--
1.6.4.2
- maint.mk and NEWS footer,
Eric Blake <=