summaryrefslogtreecommitdiff
path: root/docs-xml/scripts/find_missing_manpages.pl
blob: 612930e42df7abce1c5a835c62d3d8b151cdac21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl

my %doc;

$invar = 0;

$topdir = (shift @ARGV) or $topdir = ".";

$progs = "";

open(IN, "$topdir/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; }
}

$progs =~ s/@([^@]+)@//g;

foreach(split(/bin\//, $progs)) {
	next if($_ eq " ");
	s/\@EXEEXT\@//g;
	s/ //g;

	$f = $_;
	
	$found = 0;

	for($i = 0; $i < 9; $i++) {
		if(-e "manpages-3/$f.$i.xml") { $found = 1; }
	}

	if(!$found) {
		print "'$f' does not have a manpage\n";
	}
}