summaryrefslogtreecommitdiff
path: root/lib/ExtUtils/Install.pm
diff options
context:
space:
mode:
authorAlan Burlison <Alan.Burlison@uk.sun.com>1998-03-08 12:50:23 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-03-16 13:17:14 +0000
commit354f3b563e416c45738a8a6587f56819e7000baa (patch)
tree89664d74f3f35925e745adccd7b93a69f35aeb71 /lib/ExtUtils/Install.pm
parente9cb6d146cf75820a5771a80b499a65f1217c427 (diff)
downloadperl-354f3b563e416c45738a8a6587f56819e7000baa.tar.gz
PATCH for 5.004_62 : Add .packlist handling classes to ExtUtils
plus manual update of MANIFEST p4raw-id: //depot/perl@814
Diffstat (limited to 'lib/ExtUtils/Install.pm')
-rw-r--r--lib/ExtUtils/Install.pm31
1 files changed, 10 insertions, 21 deletions
diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm
index a3d2481224..992d178659 100644
--- a/lib/ExtUtils/Install.pm
+++ b/lib/ExtUtils/Install.pm
@@ -30,6 +30,7 @@ sub install {
use Cwd qw(cwd);
use ExtUtils::MakeMaker; # to implement a MY class
+ use ExtUtils::Packlist;
use File::Basename qw(dirname);
use File::Copy qw(copy);
use File::Find qw(find);
@@ -37,10 +38,11 @@ sub install {
use File::Compare qw(compare);
my(%hash) = %$hash;
- my(%pack, %write, $dir, $warn_permissions);
+ my(%pack, $dir, $warn_permissions);
+ my($packlist) = ExtUtils::Packlist->new();
# -w doesn't work reliably on FAT dirs
$warn_permissions++ if $^O eq 'MSWin32';
- local(*DIR, *P);
+ local(*DIR);
for (qw/read write/) {
$pack{$_}=$hash{$_};
delete $hash{$_};
@@ -63,15 +65,7 @@ sub install {
}
closedir DIR;
}
- if (-f $pack{"read"}) {
- open P, $pack{"read"} or Carp::croak("Couldn't read $pack{'read'}");
- # Remember what you found
- while (<P>) {
- chomp;
- $write{$_}++;
- }
- close P;
- }
+ $packlist->read($pack{"read"}) if (-f $pack{"read"});
my $cwd = cwd();
my $umask = umask 0 unless $Is_VMS;
@@ -134,7 +128,7 @@ sub install {
} else {
inc_uninstall($_,$File::Find::dir,$verbose,0); # nonono set to 0
}
- $write{$targetfile}++;
+ $packlist->{$targetfile}++;
}, ".");
chdir($cwd) or Carp::croak("Couldn't chdir to $cwd: $!");
@@ -144,11 +138,7 @@ sub install {
$dir = dirname($pack{'write'});
mkpath($dir,0,0755);
print "Writing $pack{'write'}\n";
- open P, ">$pack{'write'}" or Carp::croak("Couldn't write $pack{'write'}: $!");
- for (sort keys %write) {
- print P "$_\n";
- }
- close P;
+ $packlist->write($pack{'write'});
}
}
@@ -190,14 +180,13 @@ sub install_default {
}
sub uninstall {
+ use ExtUtils::Packlist;
my($fil,$verbose,$nonono) = @_;
die "no packlist file found: $fil" unless -f $fil;
# my $my_req = $self->catfile(qw(auto ExtUtils Install forceunlink.al));
# require $my_req; # Hairy, but for the first
- local *P;
- open P, $fil or Carp::croak("uninstall: Could not read packlist " .
- "file $fil: $!");
- while (<P>) {
+ my ($packlist) = ExtUtils::Packlist->new($fil);
+ foreach (sort(keys(%$packlist))) {
chomp;
print "unlink $_\n" if $verbose;
forceunlink($_) unless $nonono;