summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/c2ph.PL22
-rw-r--r--x2p/s2p.PL22
2 files changed, 44 insertions, 0 deletions
diff --git a/utils/c2ph.PL b/utils/c2ph.PL
index 38b259f0db..f9612068f4 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 9b62caac9c..7e654017b7 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