From a7471e30ba80c1cdc5253272d538a2e362f514f5 Mon Sep 17 00:00:00 2001 From: Frans Pop Date: Sat, 13 Jan 2007 20:50:15 +0000 Subject: Also support the case where a document revision is used together with a translation comment, as is the case for the Czech translation; we only check the first 10 lines of any document --- scripts/doc-check | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/doc-check b/scripts/doc-check index aac4e0470..b8d0816ea 100755 --- a/scripts/doc-check +++ b/scripts/doc-check @@ -62,24 +62,31 @@ sub getrev { my ($plfname, $enfname) = (@_); my ($plrev, $enrev, $untrans, $notconverted) = (0, 0, 0, 0); + my $line = 0; warn "checking $plfname:\n" if $opt_v; open FILE, $plfname or warn "$plfname: $!\n" and return; while () { - if (//) { + $line++; + + # Also check for revision comments of original documents + # These may be used in combination with a translation comment in + # which case the translation comment overrules what's found here + if (($plrev == 0) && (//) { + if (//) { $plrev = $1; - $untrans = 1; + $untrans = 0; + $notconverted = 0; last; } - # Also check for revision comments of original documents - if (//) { $plrev = $1; - $notconverted = 1; $untrans = 1; + $notconverted = 0; last; } # Also support CVS style revision comments (depreciated) @@ -87,6 +94,9 @@ sub getrev $plrev = $1; last; } + if ($line++ > 10) { + last; + } } warn "checking $enfname:\n" if $opt_v; open FILE, $enfname or warn "$enfname: $!\n" and return; -- cgit v1.2.3