Fix regular expressions in find_missing_doc after code format changes in
[sfrench/samba-autobuild/.git] / docs-xml / scripts / find_missing_manpages.pl
1 #!/usr/bin/perl
2
3 my %doc;
4
5 $invar = 0;
6
7 $topdir = (shift @ARGV) or $topdir = ".";
8
9 $progs = "";
10
11 open(IN, "$topdir/Makefile.in");
12 while(<IN>) {
13         if($invar && /^([ \t]*)(.*?)([\\])$/) {
14                 $progs.=" " . $2;
15                 if($4) { $invar = 1; } else { $invar = 0; }
16         } elsif(/^([^ ]*)_PROGS([0-9]*) = (.*?)([\\])$/) {
17                 $progs.=" " . $3;
18                 if($4) { $invar = 1; }
19         } else { $invar = 0; }
20 }
21
22 $progs =~ s/@([^@]+)@//g;
23
24 foreach(split(/bin\//, $progs)) {
25         next if($_ eq " ");
26         s/\@EXEEXT\@//g;
27         s/ //g;
28
29
30         $f = $_;
31         
32         $found = 0;
33
34         for($i = 0; $i < 9; $i++) {
35                 if(-e "manpages-3/$f.$i.xml") { $found = 1; }
36         }
37
38         if(!$found) {
39                 print "'$f' does not have a manpage\n";
40         }
41 }