This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
VMS build patch (from Peter Prymmer)
[perl5.git] / installhtml
index 053858d..cfbbe9f 100755 (executable)
@@ -9,8 +9,6 @@ use Getopt::Long;       # for command-line parsing
 use Cwd;
 use Pod::Html;
 
-umask 022;
-
 =head1 NAME
 
 installhtml - converts a collection of POD pages to HTML format.
@@ -161,6 +159,10 @@ $pod2html = "pod/pod2html";
 
 usage("") unless @ARGV;
 
+# Overcome shell's p1,..,p8 limitation.  
+# See vms/descrip_mms.template -> descrip.mms for invokation.
+if ( $^O eq 'VMS' ) { @ARGV = split(/\s+/,$ARGV[0]); }
+
 # parse the command-line
 $result = GetOptions( qw(
        help
@@ -236,7 +238,12 @@ foreach $dir (@splithead) {
     @data = ();
     while (<H>) {
        last if /NAME=/;
-       s,HREF="#(.*)">,HREF="$file/$1.html">,g;
+       $_ =~ s{HREF="#(.*)">}{
+           my $url = "$file/$1.html" ;
+            $url = Pod::Html::relativize_url( $url, "$file.html" )
+                if ( ! defined $opt_htmlroot || $opt_htmlroot eq '' ) ;
+            "HREF=\"$url\">" ;
+        }eg;
        push @data, $_;
     } 
     close(H);
@@ -320,9 +327,14 @@ sub create_index {
        if (defined $lcp1 and $lcp1 eq '<P>') { # Uninteresting.  Try again.
           ($lcp1,$lcp2) = ($name =~ m,/H1>\s<P>\s(\S+)\s[\s-]*(.*?)\s*$,sm);
        }
-       print HTML qq(<A HREF="$dir/$file">);
+       my $url= "$dir/$file" ;
+       if ( ! defined $opt_htmlroot || $opt_htmlroot eq '' ) {
+           $url = Pod::Html::relativize_url( "$dir/$file", $html ) ;
+       }
+
+       print HTML qq(<A HREF="$url">);
        print HTML "<DT>$lcp1</A><DD>$lcp2\n" if defined $lcp1;
-#      print HTML qq(<A HREF="$dir/$file">$lcp1</A><BR>\n") if defined $lcp1;
+#      print HTML qq(<A HREF="$url">$lcp1</A><BR>\n") if defined $lcp1;
 
        next;
 
@@ -505,7 +517,7 @@ sub installdir {
        || die "$0: error opening directory $podroot/$dir: $!\n";
 
     # find the directories to recurse on
-    @dirlist = map { "$dir/$_" }
+    @dirlist = map { if ($^O eq 'VMS') {/^(.*)\.dir$/i; "$dir/$1";} else {"$dir/$_";}}
        grep(-d "$podroot/$dir/$_" && !/^\.{1,2}/, readdir(DIR)) if $recurse;
     rewinddir(DIR);
 
@@ -576,6 +588,7 @@ sub runpod2html {
 #system("./pod2html",
         Pod::Html'pod2html(
         #Pod::Html'pod2html($pod2html,
+        "--htmldir=$htmldir",
        "--htmlroot=$htmlroot",
        "--podpath=".join(":", @podpath),
        "--podroot=$podroot", "--netscape",