mirror of
https://review.haiku-os.org/buildtools
synced 2025-01-31 10:34:41 +01:00
88896a1144
Change-Id: I42dc2a783b3e0082a7583cc7ecaa6b043ba162f4 Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3021 Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
52 lines
1.6 KiB
Perl
Executable File
52 lines
1.6 KiB
Perl
Executable File
#!/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-2020 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;
|
|
# If this is a release or a release candidate, check that
|
|
# the NEWS file does not contain FIXME or TODO.
|
|
$suf =~ /^(-rc.*)?$/ && /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";
|