source: branches/samba-3.5.x/docs-xml/scripts/find_missing_doc.pl

Last change on this file was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 1.3 KB
Line 
1#!/usr/bin/perl
2
3my %doc;
4
5$topdir = (shift @ARGV) or $topdir = ".";
6
7##################################################
8# Reading links from manpage
9
10$curdir = $ENV{PWD};
11
12chdir("smbdotconf");
13
14open(IN,"xsltproc --xinclude --param smb.context ALL generate-context.xsl parameters.all.xml|");
15
16while(<IN>) {
17 if( /<samba:parameter .*?name="([^"]*?)"/g ){
18 my $name = $1;
19 $name =~ s/ //g;
20 $doc{$name} = "NOTFOUND";
21 }
22}
23
24close(IN);
25
26chdir($curdir);
27
28#################################################
29# Reading entries from source code
30
31
32open(SOURCE,"$topdir/param/loadparm.c") or die("Can't open $topdir/param/loadparm.c: $!");
33
34while ($ln = <SOURCE>) {
35 last if $ln =~ m/^static\ struct\ parm_struct\ parm_table.*/;
36} #burn through the preceding lines
37
38while ($ln = <SOURCE>) {
39 last if $ln =~ m/^\s*\}\;\s*$/;
40 #pull in the param names only
41 next if $ln =~ m/.*P_SEPARATOR.*/;
42 next unless $ln =~ /\s*\.label\s*=\s*\"(.*)\".*/;
43
44 my $name = $1;
45 $name =~ s/ //g;
46
47 if($doc{lc($name)}) {
48 $doc{lc($name)} = "FOUND";
49 } else {
50 print "'$name' is not documented\n";
51 }
52}
53close SOURCE;
54
55##################################################
56# Trying to find missing references
57
58foreach (keys %doc) {
59 if($doc{$_} cmp "FOUND") {
60 print "'$_' is documented but is not a configuration option\n";
61 }
62}
Note: See TracBrowser for help on using the repository browser.