diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-02-24 01:25:32 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-02-24 01:25:32 +0000 |
commit | f74e69b85b023b8a16126e20be6d0905da71060b (patch) | |
tree | d9d16ba7843e447bce10011732c515fb01c4b77d /tools | |
parent | 3078c002d10eb5aadf6cc569081792cbaee4d5f8 (diff) | |
download | mpfr-f74e69b85b023b8a16126e20be6d0905da71060b.tar.gz |
Added tools/ck-news Perl script to check the NEWS file.
In Makefile.am:
* run this script in dist-hook for "make dist";
* added this script to EXTRA_DIST as it is used in dist-hook.
(merged changeset r10101 from the trunk)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10102 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/ck-news | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/ck-news b/tools/ck-news new file mode 100755 index 000000000..a7a518bb6 --- /dev/null +++ b/tools/ck-news @@ -0,0 +1,48 @@ +#!/usr/bin/env perl + +# Note: this script must not be used to build MPFR due to the +# dependency on perl, but this is OK for "make dist". + +# Copyright 2016 Free Software Foundation, Inc. +# This script is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +use strict; +use Cwd; + +if (! -d 'src') + { + getcwd() =~ m,/tools$, + or die "Execute $0 from the MPFR source directory\n"; + chdir '..' or die "$!\n$0: can't change cwd\n"; + } + +open VERSION, '<', 'VERSION' + or die "$!\n$0: can't open VERSION file\n"; +my $version = do { local $/; <VERSION> }; +close VERSION or die "$!\n$0: can't close VERSION file\n"; + +my ($base,$mv,$pl,$suf) = $version =~ /^((\d+\.\d+)\.(\d+))(-\S+)?/ + or die "$0: bad VERSION format\n"; + +my $r1 = qr/^Changes from version/; +my $r2 = qr/ to version \Q$base\E:/; +my $rx = $pl ? qr/$r1 \Q$mv\E\.@{[$pl-1]}$r2/ : qr/${r1}s? \S+\.[0*]$r2/; + +open NEWS, '<', 'NEWS' + or die "$!\n$0: can't open NEWS file\n"; +my $ok; +while (<NEWS>) + { + /$rx/ and $ok = 1; + $suf ne '-dev' && /FIXME|TODO/ and $! = 2, die "$0: $& in NEWS file"; + } +close NEWS or die "$!\n$0: can't close NEWS file\n"; + +$ok or $! = 1, die "$0: missing or bad change log in NEWS file\n"; |