X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=x2p%2Fs2p.PL;h=0e8fa8f2a6e776ce1385110e4a2b8c0bb825f476;hb=9f3698943a90afb22c82bdcf1624daed197996c5;hp=9a084f9ce5a8548cd313d2b6e838d6dfc189d6a9;hpb=d16f50bdb587818eb42f41e8f8ea1afd322f4001;p=p5sagit%2Fp5-mst-13.2.git diff --git a/x2p/s2p.PL b/x2p/s2p.PL index 9a084f9..0e8fa8f 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 cut-down version 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 @@ -43,7 +65,7 @@ $Config{perlpath} print OUT <<'!NO!SUBS!'; -$0 =~ s/^.*?(\w+)$/$1/; +$0 =~ s/^.*?(\w+)[\.\w]*$/$1/; # (p)sed - a stream editor # History: Aug 12 2000: Original version. @@ -1795,7 +1817,7 @@ if( $doGenerate ){ #!$perlpath -w eval 'exec $perlpath -S \$0 \${1+"\$@"}' if 0; -\$0 =~ s/^.*?(\\w+)\$/\$1/; +\$0 =~ s/^.*?(\\w+)\[\\.\\w+\]*\$/\$1/; use strict; use Symbol;