2002-08-27 01:57:54 +00:00
|
|
|
#!/usr/bin/perl
|
2004-03-05 05:14:21 +00:00
|
|
|
#
|
2018-02-23 09:53:12 +01:00
|
|
|
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2012-06-29 11:39:47 +10:00
|
|
|
#
|
2021-06-03 08:37:05 +02:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
#
|
2016-06-27 14:56:38 +10:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
2020-09-14 16:20:40 -07:00
|
|
|
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 09:53:12 +01:00
|
|
|
#
|
|
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
|
|
# information regarding copyright ownership.
|
2004-03-05 05:14:21 +00:00
|
|
|
|
2002-08-27 01:57:54 +00:00
|
|
|
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
|
|
|
|
if $running_under_some_shell;
|
|
|
|
# this emulates #! processing on NIH machines.
|
|
|
|
# (remove #! line above if indigestible)
|
|
|
|
|
2018-03-08 13:48:07 +11:00
|
|
|
$master = 1;
|
|
|
|
|
2002-08-27 01:57:54 +00:00
|
|
|
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
|
|
|
|
# process any FOO=bar switches
|
|
|
|
|
|
|
|
$, = ' '; # set output field separator
|
|
|
|
$\ = "\n"; # set output record separator
|
|
|
|
|
|
|
|
$change = 0;
|
|
|
|
$status = 0;
|
2018-05-23 14:31:15 +10:00
|
|
|
$wasblank = 1;
|
2002-08-27 01:57:54 +00:00
|
|
|
|
|
|
|
line: while (<>) {
|
2018-03-08 13:48:07 +11:00
|
|
|
($Fld1,$Fld2,$Fld3,$Fld4) = split(' ', $_, 9999);
|
2018-05-23 14:31:15 +10:00
|
|
|
$change = 0 if (!$master && /^\s+--- .* ---$/);
|
2002-08-27 01:57:54 +00:00
|
|
|
if ($Fld1 =~ /^[1-9][0-9]*\.$/ && $Fld2 =~ /^\[.*\]$/) {
|
2018-03-08 13:48:07 +11:00
|
|
|
if ($change != 0 && $Fld1 >= $change) {
|
|
|
|
print 'bad change number', $Fld1;
|
|
|
|
$status = 1;
|
|
|
|
}
|
|
|
|
if ($master && $change != 0 && $Fld1 + 1 != $change) {
|
2002-08-27 01:57:54 +00:00
|
|
|
print 'bad change number', $Fld1;
|
|
|
|
$status = 1;
|
|
|
|
}
|
|
|
|
$change = $Fld1;
|
2018-05-23 14:31:15 +10:00
|
|
|
if (!$wasblank) {
|
|
|
|
print 'missing blank line before change', $Fld1;
|
|
|
|
$status = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (/^\s+--- .* ---$/) {
|
|
|
|
if (!$wasblank) {
|
|
|
|
print 'missing blank line before release marker for', $Fld2;
|
|
|
|
$status = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($Fld1 eq "") {
|
|
|
|
$wasblank = 1;
|
|
|
|
} else {
|
|
|
|
$wasblank = 0;
|
2002-08-27 01:57:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
exit $status;
|