diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/find-doc-nits.pl | 13 | ||||
-rwxr-xr-x | util/find-undoc-api.pl | 13 | ||||
-rw-r--r-- | util/perl/OpenSSL/Util/Pod.pm | 13 | ||||
-rw-r--r-- | util/process_docs.pl | 19 |
4 files changed, 18 insertions, 40 deletions
diff --git a/util/find-doc-nits.pl b/util/find-doc-nits.pl index d9d16d698e..9d73c99c66 100755 --- a/util/find-doc-nits.pl +++ b/util/find-doc-nits.pl @@ -26,10 +26,6 @@ my %mandatory_sections = 3 => [ 'SYNOPSIS', 'RETURN\s+VALUES' ], 5 => [ ], 7 => [ ] ); -my %default_sections = - ( apps => 1, - crypto => 3, - ssl => 3 ); # Cross-check functions in the NAME and SYNOPSIS section. sub name_synopsis() @@ -112,8 +108,7 @@ sub check() &name_synopsis($id, $filename, $contents) unless $contents =~ /=for comment generic/ - or $contents =~ /=for comment openssl_manual_section:7/ - or $filename =~ m@/apps/@; + or $filename =~ m@man[157]/@; print "$id doesn't start with =pod\n" if $contents !~ /^=pod/; @@ -156,10 +151,8 @@ sub check() # Find what section this page is in. If run from "." assume # section 3. - my $section = $default_sections{$dirname} || 3; - if ($contents =~ /^=for\s+comment\s+openssl_manual_section:\s*(\d+)\s*$/m) { - $section = $1; - } + my $section = 3; + $section = $1 if $dirname =~ /man([1-9])/; foreach ((@{$mandatory_sections{'*'}}, @{$mandatory_sections{$section}})) { print "$id doesn't have a head1 section matching $_\n" diff --git a/util/find-undoc-api.pl b/util/find-undoc-api.pl index 7b2cb973b7..585ccc4b62 100755 --- a/util/find-undoc-api.pl +++ b/util/find-undoc-api.pl @@ -44,13 +44,11 @@ sub getdocced() my %return; foreach my $pod ( glob("$dir/*.pod") ) { - next if $pod eq 'doc/crypto/crypto.pod'; - next if $pod eq 'doc/ssl/ssl.pod'; my %podinfo = extract_pod_info($pod); foreach my $n ( @{$podinfo{names}} ) { $return{$n} = $pod; print "# Duplicate $n in $pod and $dups{$n}\n" - if defined $dups{$n}; + if defined $dups{$n} && $dups{$n} ne $pod; $dups{$n} = $pod; } } @@ -58,11 +56,11 @@ sub getdocced() return %return; } +my %docced = &getdocced('doc/man3'); + sub printem() { - my $docdir = shift; my $numfile = shift; - my %docced = &getdocced($docdir); my $count = 0; foreach my $func ( &parsenum($numfile) ) { @@ -77,6 +75,5 @@ sub printem() print "# Found $count missing from $numfile\n\n"; } - -&printem('doc/crypto', 'util/libcrypto.num'); -&printem('doc/ssl', 'util/libssl.num'); +&printem('util/libcrypto.num'); +&printem('util/libssl.num'); diff --git a/util/perl/OpenSSL/Util/Pod.pm b/util/perl/OpenSSL/Util/Pod.pm index 5c0af95918..9f76fbf1a6 100644 --- a/util/perl/OpenSSL/Util/Pod.pm +++ b/util/perl/OpenSSL/Util/Pod.pm @@ -53,11 +53,8 @@ The additional hash is for extra parameters: =item B<section =E<gt> N> -The value MUST be a number, and will be the default man section number -to be used with the given .pod file. This number can be altered if -the .pod file has a line like this: - - =for comment openssl_manual_section: 4 +The value MUST be a number, and will be the man section number +to be used with the given .pod file. =item B<debug =E<gt> 0|1> @@ -109,12 +106,6 @@ sub extract_pod_info { my %podinfo = ( section => $defaults{section}); while(<$input>) { s|\R$||; - if (m|^=for\s+comment\s+openssl_manual_section:\s*([0-9])\s*$|) { - print STDERR "DEBUG: Found man section number $1\n" - if $defaults{debug}; - $podinfo{section} = $1; - } - # Stop reading when we have reached past the NAME section. last if (m|^=head1| && defined $podinfo{lastsect} diff --git a/util/process_docs.pl b/util/process_docs.pl index 8b8de81acd..2c54f02c6c 100644 --- a/util/process_docs.pl +++ b/util/process_docs.pl @@ -28,26 +28,23 @@ use OpenSSL::Util::Pod; my %options = (); GetOptions(\%options, 'sourcedir=s', # Source directory - 'subdir=s%', # Subdirectories to look through, + 'section=i@', # Subdirectories to look through, # with associated section numbers 'destdir=s', # Destination directory #'in=s@', # Explicit files to process (ignores sourcedir) - #'section=i', # Default section used for --in files 'type=s', # The result type, 'man' or 'html' 'remove', # To remove files rather than writing them 'dry-run|n', # Only output file names on STDOUT 'debug|D+', ); -unless ($options{subdir}) { - $options{subdir} = { apps => '1', - crypto => '3', - ssl => '3' }; +unless ($options{section}) { + $options{section} = [ 1, 3, 5, 7 ]; } unless ($options{sourcedir}) { $options{sourcedir} = catdir($config{sourcedir}, "doc"); } -pod2usage(1) unless ( defined $options{subdir} +pod2usage(1) unless ( defined $options{section} && defined $options{sourcedir} && defined $options{destdir} && defined $options{type} @@ -62,8 +59,8 @@ if ($options{debug}) { if defined $options{destdir}; print STDERR "DEBUG: --type = $options{type}\n" if defined $options{type}; - foreach (keys %{$options{subdir}}) { - print STDERR "DEBUG: --subdir = $_=$options{subdir}->{$_}\n"; + foreach (sort @{$options{section}}) { + print STDERR "DEBUG: --section = $_\n"; } print STDERR "DEBUG: --remove = $options{remove}\n" if defined $options{remove}; @@ -75,8 +72,8 @@ if ($options{debug}) { my $symlink_exists = eval { symlink("",""); 1 }; -foreach my $subdir (keys %{$options{subdir}}) { - my $section = $options{subdir}->{$subdir}; +foreach my $section (sort @{$options{section}}) { + my $subdir = "man$section"; my $podsourcedir = catfile($options{sourcedir}, $subdir); my $podglob = catfile($podsourcedir, "*.pod"); |