3 # Script to check the FAQ source and make sure I have all the numbers
4 # in the right order without duplication. Also check the numbers of blank
5 # lines. It gives up on any error (other than bad blank line counts).
8 print "\nLine $line: $_[0]\n";
14 print "\nLine $line: $_[0]\n";
33 $preceded = $blankcount;
38 &poops("$preceded empty lines precede (3 expected)") if $preceded != 3;
39 &oops(sprint("Answer %02d%02d is missing\n", $section, $question))
42 $question = ($section == 20)? 0 : 1;
54 if (/^Q(\d\d)(\d\d):/)
56 &poops("$preceded empty lines precede ($expected expected)")
57 if $preceded != $expected;
60 &oops("Answer expected") if $expect_answer;
61 &oops("Q$1$2 is in the wrong section") if ($1 != $section);
62 &oops("Q$1$2 is out of order") if $2 != $question;
68 if (/^A(\d\d)(\d\d):/)
70 &poops("$preceded empty lines precede (1 expected)") if $preceded != 1;
72 &oops("Question expected") if !$expect_answer;
73 &oops("A$1$2 is in the wrong section") if $1 != $section;
74 &oops("A$1$2 is out of order") if $2 != $question++;
85 &oops("C$1 is mixed up in the Fs") if $f != 1;
86 # Some Cxxx configs are omitted (not translated from Exim 3) so can
87 # only check increasing number.
88 &oops("C$1 is out of order") if $1 < $c;
93 &oops("F$1 is out of order") if $1 != $f++;
99 exit 1 if $precede_fail;