]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Escape dots in regexps for $curr_version and $prev_version.
authorJim Meyering <jim@meyering.net>
Sat, 22 Feb 2003 16:30:28 +0000 (16:30 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 22 Feb 2003 16:30:28 +0000 (16:30 +0000)
Fail if we find no lines in NEWS.

announce-gen

index 5259f9d72e6cb2ca7d161756c5685a28cb95775f..5239949f6f97692736faba0d74dfed24969ab712 100755 (executable)
@@ -6,7 +6,7 @@ use Getopt::Long;
 use Digest::MD5;
 use Digest::SHA1;
 
-(my $VERSION = '$Revision: 1.5 $ ') =~ tr/[0-9].//cd;
+(my $VERSION = '$Revision: 1.6 $ ') =~ tr/[0-9].//cd;
 (my $ME = $0) =~ s|.*/||;
 
 END
@@ -205,21 +205,22 @@ EOF
        {
          if ( ! $in_items)
            {
-             # FIXME: quote dots
-             $line =~ /^[^ *].*$curr_version/o
+             $line =~ /^[^ *].*\Q$curr_version\E/o
                or next;
              $in_items = 1;
              print $line;
            }
          else
            {
-             # FIXME: quote dots
-             $line =~ /^[^ *].*$prev_version/o
+             $line =~ /^[^ *].*\Q$prev_version\E/o
                and last;
              print $line;
            }
        }
       close NEWS;
+
+      $in_items
+       or die "$ME: $news_file: no matching lines\n";
     }
 
   # FIXME: depend on whether it's a test release