2 # Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
15 use File::Spec::Functions qw(:DEFAULT rel2abs);
18 our($opt_i); # -i INFILE
19 our($opt_o); # -o OUTFILE
20 our($opt_t); # -t TITLE
21 our($opt_r); # -r PODROOT
24 die "-i flag missing" unless $opt_i;
25 die "-o flag missing" unless $opt_o;
26 die "-t flag missing" unless $opt_t;
27 die "-r flag missing" unless $opt_r;
29 # We originally used realpath() here, but the Windows implementation appears
30 # to require that the directory or file exist to be able to process the input,
31 # so we use rel2abs() instead, which only processes the string without
33 $opt_i = rel2abs($opt_i) or die "Can't convert to real path: $!";
34 $opt_o = rel2abs($opt_o) or die "Can't convert to real path: $!";
35 $opt_r = rel2abs($opt_r) or die "Can't convert to real path: $!";
42 "--podpath=man1:man3:man5:man7",
47 or die "Can't read $opt_o, $!";
57 s|href="http://man\.he\.net/(man\d/[^"]+)(?:\.html)?"|href="../$1.html"|g;
59 or die "Can't write $opt_o, $!";