Latest update.
This commit is contained in:
+39
-28
@@ -22,6 +22,10 @@ use OpenSSL::Util::Pod;
|
||||
# Set to 1 for debug output
|
||||
my $debug = 0;
|
||||
|
||||
# Where to find openssl command
|
||||
my $BLDTOP = $ENV{BLDTOP} || ".";
|
||||
my $openssl = "$BLDTOP/util/opensslwrap.sh";
|
||||
|
||||
# Options.
|
||||
our($opt_d);
|
||||
our($opt_e);
|
||||
@@ -597,7 +601,7 @@ sub loadmissing($)
|
||||
my @missing;
|
||||
|
||||
open FH, $missingfile
|
||||
|| die "Can't open $missingfile";
|
||||
or die "Can't open $missingfile";
|
||||
while ( <FH> ) {
|
||||
chomp;
|
||||
next if /^#/;
|
||||
@@ -607,7 +611,7 @@ sub loadmissing($)
|
||||
|
||||
for (@missing) {
|
||||
err("$missingfile:", "$_ is documented in $name_map{$_}")
|
||||
if exists $name_map{$_} && defined $name_map{$_};
|
||||
if !$opt_o && exists $name_map{$_} && defined $name_map{$_};
|
||||
}
|
||||
|
||||
return @missing;
|
||||
@@ -631,7 +635,8 @@ sub checkmacros {
|
||||
next if $f eq 'include/openssl/asn1.h';
|
||||
next if $f eq 'include/openssl/asn1t.h';
|
||||
next if $f eq 'include/openssl/err.h';
|
||||
open(IN, $f) || die "Can't open $f, $!";
|
||||
open(IN, $f)
|
||||
or die "Can't open $f, $!";
|
||||
while ( <IN> ) {
|
||||
next unless /^#\s*define\s*(\S+)\(/;
|
||||
my $macro = "$1(3)"; # We know they're all in section 3
|
||||
@@ -666,15 +671,12 @@ sub printem {
|
||||
my $count = 0;
|
||||
my %seen;
|
||||
|
||||
my @missing = loadmissing($missingfile) if ( $opt_v );
|
||||
my @missing = loadmissing($missingfile) if $opt_v;
|
||||
|
||||
foreach my $func ( parsenum($numfile) ) {
|
||||
$func .= '(3)'; # We know they're all in section 3
|
||||
next if exists $name_map{$func} || defined $seen{$func};
|
||||
|
||||
# Skip ASN1 utilities
|
||||
next if $func =~ /^ASN1_/;
|
||||
|
||||
# Skip functions known to be missing.
|
||||
next if $opt_v && grep( /^\Q$func\E$/, @missing);
|
||||
|
||||
@@ -700,7 +702,7 @@ sub collectnames {
|
||||
err($id, "$simplename not in NAME section");
|
||||
push @{$podinfo{names}}, $simplename;
|
||||
}
|
||||
foreach my $name (@{$podinfo{names}}) {
|
||||
foreach my $name ( @{$podinfo{names}} ) {
|
||||
next if $name eq "";
|
||||
err($id, "'$name' contains white space")
|
||||
if $name =~ /\s/;
|
||||
@@ -716,11 +718,10 @@ sub collectnames {
|
||||
}
|
||||
}
|
||||
|
||||
my @foreign_names =
|
||||
map { map { s/\s+//g; $_ } split(/,/, $_) }
|
||||
$podinfo{contents} =~ /=for\s+openssl\s+foreign\s+manuals:\s*(.*)\n\n/;
|
||||
foreach ( @foreign_names ) {
|
||||
$name_map{$_} = undef; # It still exists!
|
||||
if ( $podinfo{contents} =~ /=for openssl foreign manual (.*)\n/ ) {
|
||||
foreach my $f ( split / /, $1 ) {
|
||||
$name_map{$f} = undef; # It still exists!
|
||||
}
|
||||
}
|
||||
|
||||
my @links =
|
||||
@@ -738,8 +739,8 @@ sub collectnames {
|
||||
|
||||
# Look for L<> ("link") references that point to files that do not exist.
|
||||
sub checklinks {
|
||||
foreach my $filename (sort keys %link_map) {
|
||||
foreach my $link (@{$link_map{$filename}}) {
|
||||
foreach my $filename ( sort keys %link_map ) {
|
||||
foreach my $link ( @{$link_map{$filename}} ) {
|
||||
err("${filename}:1:", "reference to non-existing $link")
|
||||
unless exists $name_map{$link};
|
||||
}
|
||||
@@ -787,8 +788,8 @@ sub checkflags {
|
||||
my %localskips;
|
||||
|
||||
# Get the list of options in the command.
|
||||
open CFH, "./apps/openssl list --options $cmd|"
|
||||
|| die "Can list options for $cmd, $!";
|
||||
open CFH, "$openssl list --options $cmd|"
|
||||
or die "Can list options for $cmd, $!";
|
||||
while ( <CFH> ) {
|
||||
chop;
|
||||
s/ .$//;
|
||||
@@ -798,7 +799,7 @@ sub checkflags {
|
||||
|
||||
# Get the list of flags from the synopsis
|
||||
open CFH, "<$doc"
|
||||
|| die "Can't open $doc, $!";
|
||||
or die "Can't open $doc, $!";
|
||||
while ( <CFH> ) {
|
||||
chop;
|
||||
last if /DESCRIPTION/;
|
||||
@@ -808,8 +809,14 @@ sub checkflags {
|
||||
}
|
||||
next;
|
||||
}
|
||||
next unless /\[B<-([^ >]+)/;
|
||||
my $opt = $1;
|
||||
my $opt;
|
||||
if ( /\[B<-([^ >]+)/ ) {
|
||||
$opt = $1;
|
||||
} elsif ( /^B<-([^ >]+)/ ) {
|
||||
$opt = $1;
|
||||
} else {
|
||||
next;
|
||||
}
|
||||
$opt = $1 if $opt =~ /I<(.*)/;
|
||||
$docopts{$1} = 1;
|
||||
}
|
||||
@@ -826,7 +833,7 @@ sub checkflags {
|
||||
my @unimpl = sort grep { !defined $cmdopts{$_} } keys %docopts;
|
||||
foreach ( @unimpl ) {
|
||||
next if defined $skips{$_} || defined $localskips{$_};
|
||||
err("$cmd documented but not implemented -$_");
|
||||
err("$doc: $cmd does not implement -$_");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -841,8 +848,8 @@ if ( $opt_c ) {
|
||||
my @commands = ();
|
||||
|
||||
# Get list of commands.
|
||||
open FH, "./apps/openssl list -1 -commands|"
|
||||
|| die "Can't list commands, $!";
|
||||
open FH, "$openssl list -1 -commands|"
|
||||
or die "Can't list commands, $!";
|
||||
while ( <FH> ) {
|
||||
chop;
|
||||
push @commands, $_;
|
||||
@@ -852,8 +859,9 @@ if ( $opt_c ) {
|
||||
# See if each has a manpage.
|
||||
foreach my $cmd ( @commands ) {
|
||||
next if $cmd eq 'help' || $cmd eq 'exit';
|
||||
my $doc = "doc/man1/$cmd.pod";
|
||||
$doc = "doc/man1/openssl-$cmd.pod" if -f "doc/man1/openssl-$cmd.pod";
|
||||
my $doc = "doc/man1/openssl-$cmd.pod";
|
||||
# Handle "tsget" and "CA.pl" pod pages
|
||||
$doc = "doc/man1/$cmd.pod" if -f "doc/man1/$cmd.pod";
|
||||
if ( ! -f "$doc" ) {
|
||||
err("$doc does not exist");
|
||||
} else {
|
||||
@@ -862,8 +870,8 @@ if ( $opt_c ) {
|
||||
}
|
||||
|
||||
# See what help is missing.
|
||||
open FH, "./apps/openssl list --missing-help |"
|
||||
|| die "Can't list missing help, $!";
|
||||
open FH, "$openssl list --missing-help |"
|
||||
or die "Can't list missing help, $!";
|
||||
while ( <FH> ) {
|
||||
chop;
|
||||
my ($cmd, $flag) = split;
|
||||
@@ -882,6 +890,9 @@ if ( $opt_l || $opt_u || $opt_v ) {
|
||||
}
|
||||
|
||||
if ( $opt_l ) {
|
||||
foreach my $func ( loadmissing("util/missingcrypto.txt") ) {
|
||||
$name_map{$func} = undef;
|
||||
}
|
||||
checklinks();
|
||||
}
|
||||
|
||||
@@ -893,7 +904,7 @@ if ( $opt_n ) {
|
||||
|
||||
# If not given args, check that all man1 commands are named properly.
|
||||
if ( scalar @ARGV == 0 ) {
|
||||
foreach (glob('doc/man1/*.pod')) {
|
||||
foreach ( glob('doc/man1/*.pod') ) {
|
||||
next if /CA.pl/ || /openssl\.pod/ || /tsget\.pod/;
|
||||
err("$_ doesn't start with openssl-") unless /openssl-/;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user