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