Peter Simons wrote: > > How about removing the use of "head" and using this as the default: > > > > sed -n 1,10p > > yes, that is a really good idea.
Thanks for the patch. I've adjusted that to move comments from the log into maint.mk, where future users will be more likely to read them. Once you've done that, "(news-check-lines-spec): New variable." is all you need to say about the new variable in the log. Any additional comments or suggestions? I'll push this later today. >From 296be6b6babfbe14109df50aa22488dc05ccc878 Mon Sep 17 00:00:00 2001 From: Peter Simons <sim...@cryp.to> Date: Mon, 7 Jun 2010 15:24:21 +0200 Subject: [PATCH] maint.mk: make the news-check rule more configurable * top/maint.mk (news-check-lines-spec) New variable. (news-check): Use "sed -n 1,10p" in place of "head". --- ChangeLog | 6 ++++++ top/maint.mk | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3eb9e3a..edb9122 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-06-08 Peter Simons <sim...@cryp.to> + + maint.mk: make the news-check rule more configurable + * top/maint.mk (news-check-lines-spec) New variable. + (news-check): Use "sed -n 1,10p" in place of "head". + 2010-06-07 Jim Meyering <meyer...@redhat.com> do-release-commit-and-tag: fix typo in --help diff --git a/top/maint.mk b/top/maint.mk index 644fbb6..59e9cb5 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -103,6 +103,12 @@ endif # Override this in cfg.mk if you are using a different format in your # NEWS file. today = $(shell date +%Y-%m-%d) + +# Select which lines of NEWS are searched for $(news-check-regexp). +# This is a sed line number spec. The default says that we search +# lines 1..10 of NEWS for $(news-check-regexp). +# If you want to search only line 3 or only lines 20-22, use "3" or "20,22". +news-check-lines-spec ?= 1,10 news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)' # Prevent programs like 'sort' from considering distinct strings to be equal. @@ -874,8 +880,8 @@ sc_makefile_at_at_check: && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || : news-check: NEWS - if head $(srcdir)/NEWS | grep -E $(news-check-regexp) \ - >/dev/null; then \ + if sed -n $(news-check-lines-spec)p $(srcdir)/NEWS \ + | grep -E $(news-check-regexp) >/dev/null; then \ :; \ else \ echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2; \ -- 1.7.1.501.g23b46