summaryrefslogtreecommitdiff
path: root/lib/ExtUtils/Install.pm
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2003-06-06 11:41:45 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2003-06-07 05:11:50 +0000
commit1df8d17976b1cba61ff44907306d0eb746cb4fce (patch)
treec49a3c8b99ac20d9b3a2460f51542fc90e000a68 /lib/ExtUtils/Install.pm
parent1c41b6a40e5aeac1093e663897894b8c7836dbbb (diff)
downloadperl-1df8d17976b1cba61ff44907306d0eb746cb4fce.tar.gz
ExtUtils::MakeMaker 6.10_04 -> 6.10_05
Message-ID: <20030607014145.GB12031@windhund.schwern.org> p4raw-id: //depot/perl@19703
Diffstat (limited to 'lib/ExtUtils/Install.pm')
-rw-r--r--lib/ExtUtils/Install.pm28
1 files changed, 19 insertions, 9 deletions
diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm
index 103797353f..b5ebab6b5c 100644
--- a/lib/ExtUtils/Install.pm
+++ b/lib/ExtUtils/Install.pm
@@ -13,7 +13,6 @@ $Is_VMS = $^O eq 'VMS';
$Is_MacPerl = $^O eq 'MacOS';
my $splitchar = $^O eq 'VMS' ? '|' : ($^O eq 'os2' || $^O eq 'dos') ? ';' : ':';
-my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'} ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || '';
my $Inc_uninstall_warn_handler;
# install relative to here
@@ -56,7 +55,7 @@ perl modules. They are not designed as general purpose tools.
=item B<install>
install(\%from_to);
- install(\%from_to, $verbose, $dont_execute);
+ install(\%from_to, $verbose, $dont_execute, $uninstall_shadows);
Copies each directory tree of %from_to to its corresponding value
preserving timestamps and permissions.
@@ -70,11 +69,14 @@ on AFS it is quite likely that people are installing to a different
directory than the one where the files later appear.
If $verbose is true, will print out each file removed. Default is
-false.
+false. This is "make install VERBINST=1"
If $dont_execute is true it will only print what it was going to do
without actually doing it. Default is false.
+If $uninstall_shadows is true any differing versions throughout @INC
+will be uninstalled. This is "make install UNINST=1"
+
=cut
sub install {
@@ -147,11 +149,13 @@ sub install {
find(sub {
my ($mode,$size,$atime,$mtime) = (stat)[2,7,8,9];
return unless -f _;
- return if $_ eq ".exists";
+
+ my $origfile = $_;
+ return if $origfile eq ".exists";
my $targetdir = File::Spec->catdir($targetroot, $File::Find::dir);
- my $targetfile = File::Spec->catfile($targetdir, $_);
+ my $targetfile = File::Spec->catfile($targetdir, $origfile);
my $sourcedir = File::Spec->catdir($source, $File::Find::dir);
- my $sourcefile = File::Spec->catfile($sourcedir, $_);
+ my $sourcefile = File::Spec->catfile($sourcedir, $origfile);
my $save_cwd = cwd;
chdir $cwd; # in case the target is relative
@@ -326,9 +330,14 @@ sub uninstall {
}
sub inc_uninstall {
- my($file,$libdir,$verbose,$nonono) = @_;
+ my($filepath,$libdir,$verbose,$nonono) = @_;
my($dir);
+ my $file = (File::Spec->splitpath($filepath))[2];
my %seen_dir = ();
+
+ my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'}
+ ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || '';
+
foreach $dir (@INC, @PERL_ENV_LIB, @Config{qw(archlibexp
privlibexp
sitearchexp
@@ -342,9 +351,9 @@ sub inc_uninstall {
# know, which is the file we just installed (AFS). So we leave
# an identical file in place
my $diff = 0;
- if ( -f $targetfile && -s _ == -s $file) {
+ if ( -f $targetfile && -s _ == -s $filepath) {
# We have a good chance, we can skip this one
- $diff = compare($file,$targetfile);
+ $diff = compare($filepath,$targetfile);
} else {
print "#$file and $targetfile differ\n" if $verbose>1;
$diff++;
@@ -370,6 +379,7 @@ sub inc_uninstall {
sub run_filter {
my ($cmd, $src, $dest) = @_;
+ local(*CMD, *SRC);
open(CMD, "|$cmd >$dest") || die "Cannot fork: $!";
open(SRC, $src) || die "Cannot open $src: $!";
my $buf;