diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2003-07-09 18:31:03 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2003-07-09 18:31:03 +0000 |
commit | dd663f3f6fd296dbaf982bd74b3ea4a1a98e7ff6 (patch) | |
tree | 3d780433a7a78efba13a6c80dfc39332d25249fc /source3 | |
parent | 16ff7b26f6b9d288cbd1d39e075b637e24da13a6 (diff) | |
download | samba-dd663f3f6fd296dbaf982bd74b3ea4a1a98e7ff6.tar.gz samba-dd663f3f6fd296dbaf982bd74b3ea4a1a98e7ff6.tar.bz2 samba-dd663f3f6fd296dbaf982bd74b3ea4a1a98e7ff6.zip |
Update for docbook XML
(This used to be commit a61804b5ebc48ac9b9eb5f9b82d47fb4cf78f944)
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/script/find_missing_doc.pl | 57 |
1 files changed, 12 insertions, 45 deletions
diff --git a/source3/script/find_missing_doc.pl b/source3/script/find_missing_doc.pl index b27a405e4d..2875cf77b8 100755 --- a/source3/script/find_missing_doc.pl +++ b/source3/script/find_missing_doc.pl @@ -1,60 +1,33 @@ #!/usr/bin/perl -my $doc_file = "/docs/docbook/manpages/smb.conf.5.sgml"; -my $source_file = "/source/param/loadparm.c"; - -my %link,%doc,%param; - -# This one shouldn't be documented at all -$doc{-valid} = "FOUND"; +my %doc; $topdir = (shift @ARGV) or $topdir = "."; ################################################## # Reading links from manpage -open(IN,$topdir.$doc_file); - -while(<IN>) { - if( /<listitem><para><link linkend="([^"]*)"><parameter>([^<]*)<\/parameter><\/link><\/para><\/listitem>/g ){ - $link{$2} = $1; - $ref{$1} = $2; - } -} +$curdir = $ENV{PWD}; -close(IN); +chdir($topdir."/docs/docbook/smbdotconf"); -################################################## -# Reading documentation from manpage - -open(IN,$topdir.$doc_file) || die("Can't open $topdir$doc_file"); +open(IN,"xsltproc --xinclude --param smb.context ALL generate-context.xsl parameters.all.xml|"); while(<IN>) { - if( /<term><anchor id="([^"]*)"\/>([^<]*?)([ ]*)\(.\)([ ]*)<\/term>/g ) { - $key = $1; - $value = $2; - $doc{$value} = $key; - - # There is a reference to this entry - if($ref{$key} eq $value){ - $ref{$key} = "FOUND"; - } else { - if($ref{$key}) { - print "$key should refer to $value, but refers to " . $ref{$key} . "\n"; - } else { - print "$key should refer to $value, but has no reference!\n"; - } - $ref{$key} = $value; - } + if( /<listitem><para><link linkend="([^"]*)"><parameter moreinfo="none">([^<]*)<\/parameter><\/link><\/para><\/listitem>/g ){ + $doc{$2} = $1; } } close(IN); +chdir($curdir); + ################################################# # Reading entries from source code -open(SOURCE,$topdir.$source_file) || die("Can't open $topdir$source_file"); + +open(SOURCE,"$topdir/source/param/loadparm.c") or die("Can't open $topdir/source/param/loadparm.c: $!"); while ($ln = <SOURCE>) { last if $ln =~ m/^static\ struct\ parm_struct\ parm_table.*/; @@ -64,8 +37,8 @@ while ($ln = <SOURCE>) { last if $ln =~ m/^\s*\}\;\s*$/; #pull in the param names only next if $ln =~ m/.*P_SEPARATOR.*/; - next unless $ln =~ /.*\"(.*)\".*/; - + next unless $ln =~ /\s*\{\"(.*)\".*/; + if($doc{lc($1)}) { $doc{lc($1)} = "FOUND"; } else { @@ -77,12 +50,6 @@ close SOURCE; ################################################## # Trying to find missing references -foreach (keys %ref) { - if($ref{$_} cmp "FOUND") { - print "$_ references to " . $ref{$_} . ", but " . $ref{$_} . " isn't an anchor!\n"; - } -} - foreach (keys %doc) { if($doc{$_} cmp "FOUND") { print "$_ is documented but is not a configuration option!\n"; |