bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] announce-gen: fail if the NEWS delta is empty


From: Jim Meyering
Subject: [PATCH] announce-gen: fail if the NEWS delta is empty
Date: Tue, 17 May 2011 22:28:12 +0200

I'll hold off for a few hours, in case someone can
think of a reason to allow an empty NEWS delta.

FYI, when this condition arises, this change will cause
"make stable" to fail after generating the tarballs.

>From 3c28bd770c8d791486165514a81e70de5ab5d6bf Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 17 May 2011 22:24:59 +0200
Subject: [PATCH] announce-gen: fail if the NEWS delta is empty

If there's nothing noteworthy in NEWS, then either you forgot
or you shouldn't be releasing.
* build-aux/announce-gen: Die if the NEWS delta is effectively empty.
---
 ChangeLog              |    7 +++++++
 build-aux/announce-gen |    7 ++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 982b868..6a5ea72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-17  Jim Meyering  <address@hidden>
+
+       announce-gen: fail if the NEWS delta is empty
+       If there's nothing noteworthy in NEWS, then either you forgot
+       or you shouldn't be releasing.
+       * build-aux/announce-gen: Die if the NEWS delta is effectively empty.
+
 2011-05-17  Paul Eggert  <address@hidden>

        intprops: add doc
diff --git a/build-aux/announce-gen b/build-aux/announce-gen
index 233ee9b..0eb6b5b 100755
--- a/build-aux/announce-gen
+++ b/build-aux/announce-gen
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
     if 0;
 # Generate a release announcement message.

-my $VERSION = '2011-04-29 21:01'; # UTC
+my $VERSION = '2011-05-17 20:25'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
@@ -192,6 +192,7 @@ sub print_news_deltas ($$$)

   my $re_prefix = qr/(?:\* )?(?:Noteworthy c|Major c|C)(?i:hanges)/;

+  my $found_news;
   open NEWS, '<', $news_file
     or die "$ME: $news_file: cannot open for reading: $!\n";
   while (defined (my $line = <NEWS>))
@@ -214,12 +215,16 @@ sub print_news_deltas ($$$)
           $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o
             and last;
           print $line;
+          $line =~ /\S/
+            and $found_news = 1;
         }
     }
   close NEWS;

   $in_items
     or die "$ME: $news_file: no matching lines for `$curr_version'\n";
+  $found_news
+    or die "$ME: $news_file: no news item found for `$curr_version'\n";
 }

 sub print_changelog_deltas ($$)
--
1.7.5.1.341.g177b8



reply via email to

[Prev in Thread] Current Thread [Next in Thread]