diff options
author | Richard Levitte <levitte@openssl.org> | 2017-10-31 12:10:08 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-10-31 12:30:01 +0100 |
commit | 41d74a575d466e92f4bd35fac3f9d6027338b5ad (patch) | |
tree | 55e129272dd70f5e501b0fb77664f2c046c6c580 /util | |
parent | 7fb42788e8d1e8025c706e9b0ab5ece57b625352 (diff) |
Adapt util/find-doc-nits back to 1.1.0
This version was a direct port from 1.1.1-dev, which has a different
source structure for the docs. Adjustment done.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4633)
Diffstat (limited to 'util')
-rwxr-xr-x | util/find-doc-nits | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/util/find-doc-nits b/util/find-doc-nits index aaf3eeb4f0..598854c79e 100755 --- a/util/find-doc-nits +++ b/util/find-doc-nits @@ -154,9 +154,14 @@ sub check() my $id = "${filename}:1:"; + # Find what section this page is in; assume 3. + my $section = 3; + $section = 1 if $dirname eq 'apps'; + $section = $1 if ( $contents =~ /=for comment openssl_manual_section:(\d)/); + &name_synopsis($id, $filename, $contents) unless $contents =~ /=for comment generic/ - or $filename =~ m@man[157]/@; + or $section != 3; print "$id doesn't start with =pod\n" if $contents !~ /^=pod/; @@ -185,7 +190,7 @@ sub check() if ( $contents !~ /=for comment multiple includes/ ) { # Look for multiple consecutive openssl #include lines - # (non-consecutive lines are okay; see man3/MD5.pod). + # (non-consecutive lines are okay; see crypto/MD5.pod). if ( $contents =~ /=head1 SYNOPSIS(.*)=head1 DESCRIPTION/ms ) { my $count = 0; foreach my $line ( split /\n+/, $1 ) { @@ -211,10 +216,6 @@ sub check() close $OUT; unlink $temp || warn "Can't remove $temp, $!"; - # Find what section this page is in; assume 3. - my $section = 3; - $section = $1 if $dirname =~ /man([1-9])/; - foreach ((@{$mandatory_sections{'*'}}, @{$mandatory_sections{$section}})) { # Skip "return values" if not -s next if $_ eq 'RETURN VALUES' and not $opt_s; @@ -436,7 +437,7 @@ sub checkflags() { close CFH; # Get the list of flags from the synopsis - open CFH, "<doc/man1/$cmd.pod" + open CFH, "<doc/apps/$cmd.pod" || die "Can't open $cmd.pod, $!"; while ( <CFH> ) { chop; @@ -454,7 +455,7 @@ sub checkflags() { if ( scalar @undocced > 0 ) { $ok = 0; foreach ( @undocced ) { - print "doc/man1/$cmd.pod: Missing -$_\n"; + print "doc/apps/$cmd.pod: Missing -$_\n"; } } @@ -467,7 +468,7 @@ sub checkflags() { $ok = 0; foreach ( @unimpl ) { next if defined $skips{$_}; - print "doc/man1/$cmd.pod: Not implemented -$_\n"; + print "doc/apps/$cmd.pod: Not implemented -$_\n"; } } @@ -499,8 +500,8 @@ if ( $opt_c ) { # See if each has a manpage. foreach ( @commands ) { next if $_ eq 'help' || $_ eq 'exit'; - if ( ! -f "doc/man1/$_.pod" ) { - print "doc/man1/$_.pod does not exist\n"; + if ( ! -f "doc/apps/$_.pod" ) { + print "doc/apps/$_.pod does not exist\n"; $ok = 0; } else { $ok = 0 if not &checkflags($_); @@ -536,7 +537,7 @@ if ( $opt_n ) { } if ( $opt_u ) { - my %temp = &getdocced('doc/man3'); + my %temp = &getdocced('doc/crypto'); foreach ( keys %temp ) { $docced{$_} = $temp{$_}; } |