2 # $Cambridge: exim/doc/doc-scripts/faqchk,v 1.1 2004/10/07 15:04:35 ph10 Exp $
4 # Script to check the FAQ source and make sure I have all the numbers
5 # in the right order without duplication. Also check the numbers of blank
6 # lines. It gives up on any error (other than bad blank line counts).
9 print "\nLine $line: $_[0]\n";
15 print "\nLine $line: $_[0]\n";
34 $preceded = $blankcount;
39 &poops("$preceded empty lines precede (3 expected)") if $preceded != 3;
40 &oops(sprint("Answer %02d%02d is missing\n", $section, $question))
43 $question = ($section == 20)? 0 : 1;
55 if (/^Q(\d\d)(\d\d):/)
57 &poops("$preceded empty lines precede ($expected expected)")
58 if $preceded != $expected;
61 &oops("Answer expected") if $expect_answer;
62 &oops("Q$1$2 is in the wrong section") if ($1 != $section);
63 &oops("Q$1$2 is out of order") if $2 != $question;
69 if (/^A(\d\d)(\d\d):/)
71 &poops("$preceded empty lines precede (1 expected)") if $preceded != 1;
73 &oops("Question expected") if !$expect_answer;
74 &oops("A$1$2 is in the wrong section") if $1 != $section;
75 &oops("A$1$2 is out of order") if $2 != $question++;
86 &oops("C$1 is mixed up in the Fs") if $f != 1;
87 # Some Cxxx configs are omitted (not translated from Exim 3) so can
88 # only check increasing number.
89 &oops("C$1 is out of order") if $1 < $c;
94 &oops("F$1 is out of order") if $1 != $f++;
100 exit 1 if $precede_fail;