Add script that detects missing manpages
authorJelmer Vernooij <jelmer@samba.org>
Sat, 15 May 2004 18:08:19 +0000 (18:08 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 15 May 2004 18:08:19 +0000 (18:08 +0000)
trunk/Makefile.in
trunk/scripts/find_missing_manpages.pl [new file with mode: 0755]

index 825d8114a2986bc062ac20e2f599f8bdf08c3c33..6d5568e5b7dc690832738a16519e75312ecd8214 100644 (file)
@@ -271,6 +271,7 @@ $(MANDIR)/%: %.xml
 
 undocumented: $(SMBDOTCONFDOC)/parameters.all.xml
        @$(PERL) scripts/find_missing_doc.pl $(SRCDIR)
+       @$(PERL) scripts/find_missing_manpages.pl $(SRCDIR)
 
 # Examples and the like
 
diff --git a/trunk/scripts/find_missing_manpages.pl b/trunk/scripts/find_missing_manpages.pl
new file mode 100755 (executable)
index 0000000..b346bf0
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+my %doc;
+
+$invar = 0;
+
+$topdir = (shift @ARGV) or $topdir = ".";
+
+$progs = "";
+
+open(IN, "$topdir/source/Makefile.in");
+while(<IN>) {
+       if($invar && /^([ \t]*)(.*?)([\\])$/) {
+               $progs.=" " . $2;
+               if($4) { $invar = 1; } else { $invar = 0; }
+       } elsif(/^([^ ]*)_PROGS([0-9]*) = (.*?)([\\])$/) {
+               $progs.=" " . $3;
+               if($4) { $invar = 1; }
+       } else { $invar = 0; }
+}
+
+foreach(split(/bin\//, $progs)) {
+       next if($_ eq " ");
+       s/\@EXEEXT\@//g;
+       s/ //g;
+
+
+       $f = $_;
+       
+       $found = 0;
+
+       for($i = 0; $i < 9; $i++) {
+               if(-e "manpages/$f.$i.xml") { $found = 1; }
+       }
+
+       if(!$found) {
+               print "$f doesn't have a manpage!\n";
+       }
+}