From ed0a75d4a494e5ebc4ab50d6b9e6fb9dfe3681f4 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Fri, 7 Jul 2000 22:43:45 +0000 Subject: [PATCH] indentation and other style fixes; reindented (emacs users please (setq perl-indent 8)) --- bin/tests/system/digcomp.pl | 124 ++++++++++++++++++------------------ 1 file changed, 63 insertions(+), 61 deletions(-) diff --git a/bin/tests/system/digcomp.pl b/bin/tests/system/digcomp.pl index 16d7fc2339..2d175feba3 100644 --- a/bin/tests/system/digcomp.pl +++ b/bin/tests/system/digcomp.pl @@ -15,7 +15,7 @@ # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. -# $Id: digcomp.pl,v 1.6 2000/07/07 22:13:21 bwelling Exp $ +# $Id: digcomp.pl,v 1.7 2000/07/07 22:43:45 gson Exp $ # Compare two files, each with the output from dig, for differences. # Ignore "unimportant" differences, like ordering of NS lines, TTL's, @@ -30,79 +30,81 @@ $status = 0; $rcode1 = "none"; $rcode2 = "none"; -open(FILE1, $file1) || die("$! $file1"); +open(FILE1, $file1) || die("open: $file1: $!\n"); while () { - chomp; - if (/^;.+status:\s+(\S+).+$/) { - $rcode1 = $1; - } - next if (/^;/); - if (/^(\S+)\s+\S+\s+(\S+)\s+(\S+)\s+(.+)$/) { - $name = $1; - $class = $2; - $type = $3; - $value = $4; - if ($type eq "SOA") { - $firstname = $name if ($firstname eq ""); - if ($name eq $firstname) { - $name = "$name$count"; - $count++; - } - } - if ($entry{"$name ; $class.$type ; $value"} ne "") { - $line = $entry{"$name ; $class.$type ; $value"}; - print ("Duplicate entry in $file1:\n> $_\n< $line\n"); - } else { - $entry{"$name ; $class.$type ; $value"} = $_; - } - } + chomp; + if (/^;.+status:\s+(\S+).+$/) { + $rcode1 = $1; + } + next if (/^;/); + if (/^(\S+)\s+\S+\s+(\S+)\s+(\S+)\s+(.+)$/) { + $name = $1; + $class = $2; + $type = $3; + $value = $4; + if ($type eq "SOA") { + $firstname = $name if ($firstname eq ""); + if ($name eq $firstname) { + $name = "$name$count"; + $count++; + } + } + if ($entry{"$name ; $class.$type ; $value"} ne "") { + $line = $entry{"$name ; $class.$type ; $value"}; + print("Duplicate entry in $file1:\n> $_\n< $line\n"); + } else { + $entry{"$name ; $class.$type ; $value"} = $_; + } + } } -close (FILE1); +close(FILE1); $printed = 0; -open(FILE2, $file2) || die("$! $file2"); +open(FILE2, $file2) || die("open: $file2: $!\n"); while () { - chomp; - if (/^;.+status:\s+(\S+).+$/) { - $rcode2 = $1; - } - next if (/^;/); - if (/^(\S+)\s+\S+\s+(\S+)\s+(\S+)\s+(.+)$/) { - $name = $1; - $class = $2; - $type = $3; - $value = $4; - if (($name eq $firstname) && ($type eq "SOA")) { - $count--; - $name = "$name$count"; - } - if ($entry{"$name ; $class.$type ; $value"} ne "") { - $entry{"$name ; $class.$type ; $value"} = ""; - } else { - print ("Only in $file2 (missing from $file1):\n") if ($printed == 0); - print ("> $_\n"); - $printed++; - $status = 1; - } - } + chomp; + if (/^;.+status:\s+(\S+).+$/) { + $rcode2 = $1; + } + next if (/^;/); + if (/^(\S+)\s+\S+\s+(\S+)\s+(\S+)\s+(.+)$/) { + $name = $1; + $class = $2; + $type = $3; + $value = $4; + if (($name eq $firstname) && ($type eq "SOA")) { + $count--; + $name = "$name$count"; + } + if ($entry{"$name ; $class.$type ; $value"} ne "") { + $entry{"$name ; $class.$type ; $value"} = ""; + } else { + print("Only in $file2 (missing from $file1):\n") + if ($printed == 0); + print("> $_\n"); + $printed++; + $status = 1; + } + } } -close (FILE2); +close(FILE2); $printed = 0; foreach $key (keys(%entry)) { - if ($entry{$key} ne "") { - print ("Only in $file1 (missing from $file2):\n") if ($printed == 0); - print ("< $entry{$key}\n"); - $status = 1; - $printed++; - } + if ($entry{$key} ne "") { + print("Only in $file1 (missing from $file2):\n") + if ($printed == 0); + print("< $entry{$key}\n"); + $status = 1; + $printed++; + } } -if ($rcode1 !~ $rcode2) { - print ("< status: $rcode1\n"); - print ("> status: $rcode2\n"); +if ($rcode1 ne $rcode2) { + print("< status: $rcode1\n"); + print("> status: $rcode2\n"); } exit($status);