Hi Jim,

 > How about removing the use of "head" and using this as the default:
 >
 > sed -n 1,10p

yes, that is a really good idea.

Take care,
Peter


>From b0e59e16e848f5a6f65fb2a8d5cb16a5355a8a37 Mon Sep 17 00:00:00 2001
From: Peter Simons <sim...@cryp.to>
Date: Mon, 7 Jun 2010 15:24:21 +0200
Subject: [PATCH] Introduced the $(news-check-lines-spec) variable in maint.mk.

$(news-check-lines-spec) determines the range of lines inspected by
the 'news-check' target to ensure that the NEWS file is up-to-date.
The default value is "1,10", meaning that any of lines 1 to 10 must
match $(news-check-regexp) for the test to succeed.
---
 ChangeLog    |    8 ++++++++
 top/maint.mk |    5 +++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3eb9e3a..ca5b2ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-06-08  Peter Simons  <sim...@cryp.to>
+
+        * top/maint.mk: Introduced the variable $(news-check-lines-spec) to
+        determine the range of lines inspected by the 'news-check' target to
+        ensure that the NEWS file is up-to-date. The default value is "1,10",
+        meaning that any of lines 1 to 10 must match $(news-check-regexp) for
+        the test to succeed.
+
 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..f7c4ddd 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -104,6 +104,7 @@ endif
 # NEWS file.
 today = $(shell date +%Y-%m-%d)
 news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
+news-check-lines-spec ?= 1,10
 
 # Prevent programs like 'sort' from considering distinct strings to be equal.
 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
@@ -874,8 +875,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

Reply via email to