This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Undo private patch
[perl5.git] / lib / ExtUtils / Install.pm
index 45bd2d7..71f553b 100644 (file)
@@ -1,7 +1,7 @@
 package ExtUtils::Install;
 
-$VERSION = substr q$Revision: 1.12 $, 10;
-# $Id: Install.pm,v 1.12 1996/06/23 20:46:07 k Exp $
+$VERSION = substr q$Revision: 1.16 $, 10;
+# $Date: 1996/12/17 00:31:26 $
 
 use Exporter;
 use Carp ();
@@ -12,7 +12,7 @@ use vars qw(@ISA @EXPORT $VERSION);
 $Is_VMS = $^O eq 'VMS';
 
 my $splitchar = $^O eq 'VMS' ? '|' : $^O eq 'os2' ? ';' : ':';
-my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'} ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'};
+my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'} ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || '';
 my $Inc_uninstall_warn_handler;
 
 #use vars qw( @EXPORT @ISA $Is_VMS );
@@ -34,16 +34,9 @@ sub install {
     use File::Copy qw(copy);
     use File::Find qw(find);
     use File::Path qw(mkpath);
-    # The following lines were needed with AutoLoader (left for the record)
-    # my $my_req = $self->catfile(qw(auto ExtUtils Install my_cmp.al));
-    # require $my_req;
-    # $my_req = $self->catfile(qw(auto ExtUtils Install forceunlink.al));
-    # require $my_req; # Hairy, but for the first
-    # time use we are in a different directory when autoload happens, so
-    # the relativ path to ./blib is ill.
 
     my(%hash) = %$hash;
-    my(%pack, %write, $dir);
+    my(%pack, %write, $dir, $warn_permissions);
     local(*DIR, *P);
     for (qw/read write/) {
        $pack{$_}=$hash{$_};
@@ -59,7 +52,8 @@ sub install {
            if (-w $hash{$source_dir_or_file} || mkpath($hash{$source_dir_or_file})) {
                last;
            } else {
-               Carp::croak("You do not have permissions to install into $hash{$source_dir_or_file}");
+               warn "Warning: You do not have permissions to install into $hash{$source_dir_or_file}"
+                   unless $warn_permissions++;
            }
        }
        closedir DIR;
@@ -239,6 +233,17 @@ sub pm_to_blib {
     # my $my_req = $self->catfile(qw(auto ExtUtils Install forceunlink.al));
     # require $my_req; # Hairy, but for the first
 
+    if (!ref($fromto) && -r $fromto)
+     {
+      # Win32 has severe command line length limitations, but
+      # can generate temporary files on-the-fly
+      # so we pass name of file here - eval it to get hash 
+      open(FROMTO,"<$fromto") or die "Cannot open $fromto:$!";
+      my $str = '$fromto = {qw{'.join('',<FROMTO>).'}}';
+      eval $str;
+      close(FROMTO);
+     }
+
     my $umask = umask 0022 unless $Is_VMS;
     mkpath($autodir,0,0755);
     foreach (keys %$fromto) {
@@ -253,7 +258,9 @@ sub pm_to_blib {
            mkpath(dirname($fromto->{$_}),0,0755);
        }
        copy($_,$fromto->{$_});
-       chmod(0444 | ( (stat)[2] & 0111 ? 0111 : 0 ),$fromto->{$_});
+       my($mode,$atime,$mtime) = (stat)[2,8,9];
+       utime($atime,$mtime+$Is_VMS,$fromto->{$_});
+       chmod(0444 | ( $mode & 0111 ? 0111 : 0 ),$fromto->{$_});
        print "cp $_ $fromto->{$_}\n";
        next unless /\.pm$/;
        autosplit($fromto->{$_},$autodir);
@@ -318,8 +325,8 @@ be copied preserving timestamps and permissions.
 
 There are two keys with a special meaning in the hash: "read" and
 "write". After the copying is done, install will write the list of
-target files to the file named by $hashref->{write}. If there is
-another file named by $hashref->{read}, the contents of this file will
+target files to the file named by C<$hashref-E<gt>{write}>. If there is
+another file named by C<$hashref-E<gt>{read}>, the contents of this file will
 be merged into the written file. The read and the written file may be
 identical, but on AFS it is quite likely, people are installing to a
 different directory than the one where the files later appear.
@@ -334,4 +341,3 @@ the extension pm are autosplit. Second argument is the autosplit
 directory.
 
 =cut
-