check-changes revision 70e5a7403f0e0a3bd292b8287c5fed5772c15270
2285N/A#!/usr/bin/perl
2285N/A#
2285N/A# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
2285N/A# Copyright (C) 2002 Internet Software Consortium.
2285N/A#
2285N/A# Permission to use, copy, modify, and/or distribute this software for any
2285N/A# purpose with or without fee is hereby granted, provided that the above
2285N/A# copyright notice and this permission notice appear in all copies.
2285N/A#
2285N/A# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
2285N/A# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2285N/A# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
2285N/A# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2285N/A# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
2285N/A# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2285N/A# PERFORMANCE OF THIS SOFTWARE.
2285N/A
2285N/A# $Id: check-changes,v 1.4 2007/06/19 23:47:24 tbox Exp $
2285N/A
2285N/Aeval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
2285N/A if $running_under_some_shell;
2285N/A # this emulates #! processing on NIH machines.
2285N/A # (remove #! line above if indigestible)
2285N/A
2285N/Aeval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
2285N/A # process any FOO=bar switches
2285N/A
2285N/A$, = ' '; # set output field separator
2285N/A$\ = "\n"; # set output record separator
2285N/A
2285N/A$change = 0;
2285N/A$status = 0;
2285N/A
2285N/Aline: while (<>) {
2285N/A ($Fld1,$Fld2) = split(' ', $_, 9999);
2285N/A if ($Fld1 =~ /^[1-9][0-9]*\.$/ && $Fld2 =~ /^\[.*\]$/) {
2285N/A if ($change != 0 && $Fld1 + 1 != $change) {
2285N/A print 'bad change number', $Fld1;
2285N/A $status = 1;
2285N/A }
2285N/A $change = $Fld1;
2285N/A }
2285N/A}
2285N/A
2285N/Aexit $status;
2285N/A