From: Jarkko Hietaniemi Date: Thu, 6 Jun 2002 16:10:24 +0000 (+0000) Subject: Make pstruct and psed appear also on platforms with X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=231bc313da16da9d626e684e44737b52da2914ce;p=p5sagit%2Fp5-mst-13.2.git Make pstruct and psed appear also on platforms with $Config{d_link} but filesystems without link() (like FAT). Should deal with [ID 20020602.003] and "RC1 for MSWin32-x86-multi-thread build bug report". Diagnosis by Sarathy. p4raw-id: //depot/perl@17038 --- diff --git a/utils/c2ph.PL b/utils/c2ph.PL index 38b259f..f961206 100644 --- a/utils/c2ph.PL +++ b/utils/c2ph.PL @@ -3,6 +3,28 @@ use Config; use File::Basename qw(&basename &dirname); use Cwd; +use subs qw(link); + +sub link { # This is a cutdown vesion of installperl:link(). + my($from,$to) = @_; + my($success) = 0; + + eval { + CORE::link($from, $to) + ? $success++ + : ($from =~ m#^/afs/# || $to =~ m#^/afs/#) + ? die "AFS" # okay inside eval {} + : die "Couldn't link $from to $to: $!\n"; + }; + if ($@) { + warn $@; + require File::Copy; + File::Copy::copy($from, $to) + ? $success++ + : warn "Couldn't copy $from to $to: $!\n"; + } + $success; +} # List explicitly here the variables you want Configure to # generate. Metaconfig only looks for shell variables, so you diff --git a/x2p/s2p.PL b/x2p/s2p.PL index 9b62caa..7e65401 100644 --- a/x2p/s2p.PL +++ b/x2p/s2p.PL @@ -3,6 +3,28 @@ use Config; use File::Basename qw(&basename &dirname); use Cwd; +use subs qw(link); + +sub link { # This is a cutdown vesion of installperl:link(). + my($from,$to) = @_; + my($success) = 0; + + eval { + CORE::link($from, $to) + ? $success++ + : ($from =~ m#^/afs/# || $to =~ m#^/afs/#) + ? die "AFS" # okay inside eval {} + : die "Couldn't link $from to $to: $!\n"; + }; + if ($@) { + warn $@; + require File::Copy; + File::Copy::copy($from, $to) + ? $success++ + : warn "Couldn't copy $from to $to: $!\n"; + } + $success; +} # List explicitly here the variables you want Configure to # generate. Metaconfig only looks for shell variables, so you