From: Jarkko Hietaniemi Date: Sat, 8 Jun 2002 17:04:24 +0000 (+0000) Subject: Workaround for broken symlink traversal. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5f239f738af2139a8fc4f623d7bc64b919ff8840;p=p5sagit%2Fp5-mst-13.2.git Workaround for broken symlink traversal. p4raw-id: //depot/perl@17102 --- diff --git a/installperl b/installperl index dcc92a5..5c42324 100755 --- a/installperl +++ b/installperl @@ -814,13 +814,27 @@ sub installlib { sub copy_if_diff { my($from,$to)=@_; return 1 if (($^O eq 'VMS') && (-d $from)); - -f $from || warn "$0: $from not found"; + my $perlpodbadsymlink; + if ($from =~ m!^pod/perl[\w-]+\.pod$! && + -l $from && + ! -e $from) { + # Some Linux implementations have problems traversing over + # multiple symlinks (when going over NFS?) and fail to read + # the symlink target. Combine this with the fact that some + # of the pod files (the perl$OS.pod) are symlinks (to ../README.$OS), + # and you end up with those pods not getting installed. + $perlpodbadsymlink = 1; + } + -f $from || $perlpodbadsymlink || warn "$0: $from not found"; $packlist->{$to} = { type => 'file' }; if (compare($from, $to) || $nonono) { safe_unlink($to); # In case we don't have write permissions. if ($nonono) { $from = $depth . "/" . $from if $depth; } + if ($perlpodbadsymlink && $from =~ m!^pod/perl(.+)\.pod$!) { + $from = "README.$1"; + } copy($from, $to); # Restore timestamps if it's a .a library or for OS/2. if (!$nonono && ($Is_OS2 || $to =~ /\.a$/)) {