summaryrefslogtreecommitdiffstats
path: root/util/process_docs.pl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-12-02 20:39:46 +0100
committerRichard Levitte <levitte@openssl.org>2018-12-03 10:00:14 +0100
commitb608fabfcca597e66c2e115e902b56ed828e8bea (patch)
tree85d27f590a1c1cccd39bf44843f7e9b7038b7506 /util/process_docs.pl
parent547a3320fcaa971ab2e827a4cd6512199607c9e9 (diff)
util/process_docs.pl: handle multiple source directories for .pod files
From now on, the default is to look in both the source directory and the build directory. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/7742)
Diffstat (limited to 'util/process_docs.pl')
-rwxr-xr-xutil/process_docs.pl16
1 files changed, 9 insertions, 7 deletions
diff --git a/util/process_docs.pl b/util/process_docs.pl
index 30b149eb8f..fcce8d8661 100755
--- a/util/process_docs.pl
+++ b/util/process_docs.pl
@@ -29,7 +29,7 @@ use OpenSSL::Util::Pod;
my %options = ();
GetOptions(\%options,
- 'sourcedir=s', # Source directory
+ 'sourcedir=s@', # Source directories
'section=i@', # Subdirectories to look through,
# with associated section numbers
'destdir=s', # Destination directory
@@ -46,7 +46,8 @@ unless ($options{section}) {
$options{section} = [ 1, 3, 5, 7 ];
}
unless ($options{sourcedir}) {
- $options{sourcedir} = catdir($config{sourcedir}, "doc");
+ $options{sourcedir} = [ catdir($config{sourcedir}, "doc"),
+ catdir($config{builddir}, "doc") ];
}
pod2usage(1) unless ( defined $options{section}
&& defined $options{sourcedir}
@@ -59,8 +60,9 @@ pod2usage(1) if ( $options{type} eq 'html'
if ($options{debug}) {
print STDERR "DEBUG: options:\n";
- print STDERR "DEBUG: --sourcedir = $options{sourcedir}\n"
- if defined $options{sourcedir};
+ foreach (sort @{$options{sourcedir}}) {
+ print STDERR "DEBUG: --sourcedir = $_\n";
+ }
print STDERR "DEBUG: --destdir = $options{destdir}\n"
if defined $options{destdir};
print STDERR "DEBUG: --type = $options{type}\n"
@@ -82,10 +84,10 @@ my $symlink_exists = eval { symlink("",""); 1 };
foreach my $section (sort @{$options{section}}) {
my $subdir = "man$section";
- my $podsourcedir = catfile($options{sourcedir}, $subdir);
- my $podglob = catfile($podsourcedir, "*.pod");
+ my @podsourcedirs = map { catfile($_, $subdir); } @{$options{sourcedir}};
+ my @podglobs = map { catfile($_, "*.pod"); } @podsourcedirs;
- foreach my $podfile (glob $podglob) {
+ foreach my $podfile (map { glob $_ } @podglobs) {
my $podname = basename($podfile, ".pod");
my $podpath = catfile($podfile);
my %podinfo = extract_pod_info($podpath,