summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-11-02 14:55:29 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-11-02 14:55:29 +0000
commitbe61d08ee327e91edc6bb39a13e0138e0eed393a (patch)
tree26841bfa2bf992b7b5d46e3fa2a048d82df04d9f
parent5f4126c4053727fca3daf460aeaca04d8744eb97 (diff)
downloadperl-be61d08ee327e91edc6bb39a13e0138e0eed393a.tar.gz
Make installman work with -Duserelocatableinc and DESTDIR
p4raw-id: //depot/perl@32212
-rwxr-xr-xinstallman26
1 files changed, 26 insertions, 0 deletions
diff --git a/installman b/installman
index d27271e687..8f6bd80d2a 100755
--- a/installman
+++ b/installman
@@ -1,6 +1,32 @@
#!./perl -w
BEGIN { @INC = qw(lib) }
use strict;
+
+BEGIN {
+ use Config;
+ if ($Config{userelocatableinc}) {
+ # This might be a considered a hack. Need to get information about the
+ # configuration from Config.pm *before* Config.pm expands any .../
+ # prefixes.
+ #
+ # So we set $^X to pretend that we're the already installed perl, so
+ # Config.pm doesits ... expansion off that location.
+
+ my $location = $Config{initialinstalllocation};
+ die <<'OS' unless defined $location;
+$Config{initialinstalllocation} is not defined - can't install a relocatable
+perl without this.
+OS
+ $^X = "$location/perl";
+ # And then remove all trace of ever having loaded Config.pm, so that
+ # it will reload with the revised $^X
+ undef %Config::;
+ delete $INC{"Config.pm"};
+ delete $INC{"Config_heavy.pl"};
+ # You never saw us. We weren't here.
+ }
+}
+
use Config;
use Getopt::Long;
use File::Find;