From: Richard Levitte Date: Mon, 6 Mar 2017 20:40:48 +0000 (+0100) Subject: util/process_docs.pl: make it possible to add a suffix to man docs X-Git-Tag: OpenSSL_1_1_0f~177 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7a9c3fcb5fc11cc102c4520514e01c09a62a1d8;p=openssl util/process_docs.pl: make it possible to add a suffix to man docs Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2864) --- diff --git a/util/process_docs.pl b/util/process_docs.pl index 9834dbe39d..073a3b7031 100644 --- a/util/process_docs.pl +++ b/util/process_docs.pl @@ -34,6 +34,8 @@ GetOptions(\%options, #'in=s@', # Explicit files to process (ignores sourcedir) #'section=i', # Default section used for --in files 'type=s', # The result type, 'man' or 'html' + 'suffix:s', # Suffix to add to the extension. + # Only used with type=man 'remove', # To remove files rather than writing them 'dry-run|n', # Only output file names on STDOUT 'debug|D+', @@ -53,6 +55,8 @@ pod2usage(1) unless ( defined $options{subdir} && defined $options{type} && ($options{type} eq 'man' || $options{type} eq 'html') ); +pod2usage(1) if ( $options{type} eq 'html' + && defined $options{suffix} ); if ($options{debug}) { print STDERR "DEBUG: options:\n"; @@ -62,6 +66,8 @@ if ($options{debug}) { if defined $options{destdir}; print STDERR "DEBUG: --type = $options{type}\n" if defined $options{type}; + print STDERR "DEBUG: --suffix = $options{suffix}\n" + if defined $options{suffix}; foreach (keys %{$options{subdir}}) { print STDERR "DEBUG: --subdir = $_=$options{subdir}->{$_}\n"; } @@ -90,7 +96,7 @@ foreach my $subdir (keys %{$options{subdir}}) { my $updir = updir(); my $name = uc $podname; - my $suffix = { man => ".$podinfo{section}", + my $suffix = { man => ".$podinfo{section}".($options{suffix} // ""), html => ".html" } -> {$options{type}}; my $generate = { man => "pod2man --name=$name --section=$podinfo{section} --center=OpenSSL --release=$config{version} \"$podpath\"", html => "pod2html \"--podroot=$options{sourcedir}\" --htmldir=$updir --podpath=apps:crypto:ssl \"--infile=$podpath\" \"--title=$podname\"" @@ -177,6 +183,7 @@ B [B<--sourcedir>=I] B<--destdir>=I B<--type>=B|B +[B<--suffix>=I] [B<--remove>] [B<--dry-run>|B<-n>] [B<--debug>|B<-D>] @@ -209,6 +216,10 @@ Top directory where the resulting files should end up Type of output to produce. Currently supported are man pages and HTML files. +=item B<--suffix>=I + +A suffix added to the extension. Only valid with B<--type>=B + =item B<--remove> Instead of writing the files, remove them.