Nit about pod filenames
authorRich Salz <rsalz@openssl.org>
Tue, 7 Jun 2016 17:08:20 +0000 (13:08 -0400)
committerRich Salz <rsalz@openssl.org>
Tue, 7 Jun 2016 18:46:33 +0000 (14:46 -0400)
The asdf.pod filename must have asdf in its NAME section.
also check for names existing as a different filename (via Levitte)

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
doc/crypto/X509_PUBKEY_new.pod [moved from doc/crypto/X509_PUBKEY.pod with 100% similarity]
util/find-doc-nits.pl

index b0fab95..59647f9 100755 (executable)
@@ -48,10 +48,24 @@ sub name_synopsis()
     $tmp =~ tr/\n/ /;
     $tmp =~ s/-.*//g;
     $tmp =~ s/,//g;
+
+    my $dirname = dirname($filename);
+    my $simplename = basename($filename);
+    $simplename =~ s/.pod$//;
+    my $foundfilename = 0;
+    my %foundfilenames = ();
     my %names;
     foreach my $n ( split ' ', $tmp ) {
         $names{$n} = 1;
+        $foundfilename++ if $n eq $simplename;
+        $foundfilenames{$n} = 1
+            if -f "$dirname/$n.pod" && $n ne $simplename;
     }
+    print "$id the following exist as other .pod files:\n",
+        join(" ", sort keys %foundfilenames), "\n"
+        if %foundfilenames;
+    print "$id $simplename (filename) missing from NAME section\n",
+        unless $foundfilename;
 
     # Find all functions in SYNOPSIS
     return unless $contents =~ /=head1 SYNOPSIS(.*)=head1 DESCRIPTION/ms;