X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/776d31feeb0161f4118b833a7b36f8270236bd3b..c411974dd51c7d7c0ee08434cc1bb9b77909385d:/installhtml diff --git a/installhtml b/installhtml index 9884f27..5a76ba0 100755 --- a/installhtml +++ b/installhtml @@ -4,6 +4,7 @@ use strict; use Config; # for config options in the makefile +use File::Spec; use Getopt::Long; # for command-line parsing use Cwd; use Pod::Html 'anchorify'; @@ -293,15 +294,6 @@ sub parse_command_line { } -sub absolute_path { - my($cwd, $path) = @_; - return "$cwd/$path" unless $path =~ m:/:; - # add cwd if path is not already an absolute path - $path = "$cwd/$path" if (substr($path,0,1) ne '/'); - return $path; -} - - sub create_index { my($html, $dir) = @_; (my $pod = $dir) =~ s,^.*/,,; @@ -391,7 +383,8 @@ sub split_on_item { print "splitting files by item.\n" if $verbose && $#splititem >= 0; $pwd = getcwd(); - my $splitter = absolute_path($pwd, "$splitpod/splitpod"); + my $splitter = File::Spec->rel2abs("$splitpod/splitpod", $pwd); + my $perl = File::Spec->rel2abs($^X, $pwd); foreach my $pod (@splititem) { # figure out the directory to split into $pod =~ s,^([^/]*)$,/$1,; @@ -412,7 +405,7 @@ sub split_on_item { die "$0: error changing to directory $podroot/$dirname: $!\n"; die "$splitter not found. Use '-splitpod dir' option.\n" unless -f $splitter; - system("perl", $splitter, "../$filename") && + system($perl, $splitter, "../$filename") && warn "$0: error running '$splitter ../$filename'" ." from $podroot/$dirname"; }