find_missing_manpages.pl: Adapt script to changed directory structure. samba-3.2.4
authorKarolin Seeger <kseeger@samba.org>
Wed, 17 Sep 2008 06:48:19 +0000 (08:48 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 18 Sep 2008 06:49:02 +0000 (08:49 +0200)
Karolin
(cherry picked from commit b6b7aa023b62ab8994d13cb91d5185204c1500b2)
(cherry picked from commit d553faff4ae9aa1fdc1bb716e901dcede7799f27)

docs-xml/scripts/find_missing_manpages.pl

index c468d7d1ee149875f95b22e36d2c0aa5639a9a8a..aa5751b44a260a0952d0f1b642d16372d4ff175e 100755 (executable)
@@ -1,14 +1,25 @@
 #!/usr/bin/perl
 
-my %doc;
-
 $invar = 0;
-
 $topdir = (shift @ARGV) or $topdir = ".";
-
+$makefile = "$topdir/source/Makefile.in";
+$mandir = "$topdir/docs-xml/manpages-3";
 $progs = "";
 
-open(IN, "$topdir/Makefile.in");
+chdir($topdir);
+
+if(! -e "$makefile") {
+       print "$makefile does not exist!\n";
+       print "Wrong directory?\n";
+       exit(1);
+}
+
+if(! -d "$mandir") {
+        print "$mandir does not exist!\n";
+        exit(1);
+}
+
+open(IN, "$makefile");
 while(<IN>) {
        if($invar && /^([ \t]*)(.*?)([\\])$/) {
                $progs.=" " . $2;
@@ -22,15 +33,17 @@ while(<IN>) {
 foreach(split(/bin\//, $progs)) {
        next if($_ eq " ");
        s/\@EXEEXT\@//g;
+       s/\@EXTRA_BIN_PROGS\@//g;
        s/ //g;
 
 
        $f = $_;
-       
+
        $found = 0;
 
+
        for($i = 0; $i < 9; $i++) {
-               if(-e "manpages/$f.$i.xml") { $found = 1; }
+               if(-e "$mandir/$f.$i.xml") { $found = 1; }
        }
 
        if(!$found) {