X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=installperl;h=8d5573db4452baf05fc422a91f1362b429a4c852;hb=a26c0e281cb6068a8d148933281d8186f1eb4206;hp=b014f80761609a4926433573ae80afb057c72cb7;hpb=b5920ff0f6b65443a39b58d7cf4cd21351bedd92;p=p5sagit%2Fp5-mst-13.2.git diff --git a/installperl b/installperl index b014f80..8d5573d 100755 --- a/installperl +++ b/installperl @@ -67,6 +67,11 @@ if ( $Is_VMS ) { } $otherperls = 1; +# This little hack simplifies making the code after the comment "Fetch some +# frequently-used items from %Config" warning free. With $opts{destdir} always +# defined, it's also possible to make the s/\Q$opts{destdir}\E unconditional. + +$opts{destdir} = ''; # Consider refactoring this to use Getopt::Long once Getopt::Long's planned # feature is implemented, to distinguish + and - options. while (@ARGV) { @@ -148,8 +153,13 @@ if ((-e "testcompile") && (defined($ENV{'COMPILE'}))) { push(@scripts, map("$_.exe", @scripts)); } +# Exclude nonxs extensions that are not architecture dependent +my @nonxs = grep(!/^Errno$/, split(' ', $Config{'nonxs_ext'})); + find(sub { - if ("$File::Find::dir/$_" =~ m{^ext\b(.*)/([^/]+)\.pm$}) { + if (($File::Find::name =~ m{^ext\b(.*)/([^/]+)\.pm$}) && + ! grep { $File::Find::name =~ /^ext\/$_/ } @nonxs) + { my($path, $modname) = ($1,$2); # strip to optional "/lib", or remove trailing component @@ -207,7 +217,6 @@ if ($nwinstall) { $installsitelib = $Config{installnwlib}; } -my $d_dosuid = $Config{d_dosuid}; my $binexp = $Config{binexp}; if ($Is_VMS) { # Hang in there until File::Spec hits the big time @@ -220,8 +229,6 @@ if ($Is_VMS) { # Hang in there until File::Spec hits the big time # Do some quick sanity checks. -if (!$opts{notify} && $d_dosuid && $>) { die "You must run as root to install suidperl\n"; } - $installbin || die "No installbin directory in config.sh\n"; -d $installbin || mkpath($installbin, $opts{verbose}, 0777); -d $installbin || $opts{notify} || die "$installbin is not a directory\n"; @@ -238,7 +245,6 @@ else { -x $dbg . 'perl' . $exe_ext || die "${dbg}perl$exe_ext isn't executable!\n"; } } --x 'suidperl' . $exe_ext|| die "suidperl isn't executable!\n" if $d_dosuid; -f 't/rantests' || $Is_W32 || warn "WARNING: You've never run 'make test' or", @@ -326,12 +332,6 @@ else { copy("perl.exe", "$installbin/$perl.exe"); } -safe_unlink("$installbin/s$perl_verbase$ver$exe_ext"); -if ($d_dosuid) { - copy("suidperl$exe_ext", "$installbin/s$perl_verbase$ver$exe_ext"); - chmod(04711, "$installbin/s$perl_verbase$ver$exe_ext"); -} - # Install library files. my ($do_installarchlib, $do_installprivlib) = (0, 0); @@ -365,12 +365,24 @@ if ($Is_VMS) { # We did core file selection during build map { s|^$coredir/||i; } @corefiles = <$coredir/*.*>; } elsif ($Is_Cygwin) { # On Cygwin symlink it to CORE to make Makefile happy + @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>; my $coredll = "$installarchlib/CORE/$libperl"; + safe_unlink($coredll); ( $Config{'d_link'} eq 'define' && - eval { CORE::link "$installbin/$libperl", $coredll } ) || - eval { symlink "$installbin/$libperl", $coredll } || - copy("$installbin/$libperl", $coredll); - @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>; + eval { + CORE::link("$installbin/$libperl", $coredll); + $packlist->{$coredll} = { from => "$installbin/$libperl", + type => 'link' }; + } + ) || + eval { + symlink("$installbin/$libperl", $coredll); + $packlist->{$coredll} = { from => "$installbin/$libperl", + type => 'link' }; + } || + ( copy("$installbin/$libperl", $coredll) && + push(@corefiles, $coredll) + ) } else { # [als] hard-coded 'libperl' name... not good! @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>; @@ -415,9 +427,6 @@ if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VM link("$installbin/$perl_verbase$ver$exe_ext", "$installbin/$perl$exe_ext"); } - link("$installbin/$perl_verbase$ver$exe_ext", - "$installbin/suid$perl$exe_ext") - if $d_dosuid; } # For development purposes it can be very useful to have multiple perls @@ -595,6 +604,7 @@ if (!$versiononly && $otherperls) { next unless m,^/,; # Use &samepath here because some systems have other dirs linked # to $mainperldir (like SunOS) + next unless -d; next if samepath($_, $binexp); next if samepath($_, cwd()); next if ($mainperl_is_instperl && samepath($_, $mainperldir)); @@ -669,7 +679,7 @@ sub copy { my($from,$to) = @_; my $xto = $to; - $xto =~ s/^\Q$opts{destdir}\E// if $opts{destdir}; + $xto =~ s/^\Q$opts{destdir}\E//; print $opts{verbose} ? " cp $from $xto\n" : " $xto\n" unless $opts{silent}; print " creating new version of $xto\n" @@ -732,11 +742,13 @@ sub installlib { $name = "$dir/$name" if $dir ne ''; + return if $name eq 'ExtUtils/XSSymSet.pm' and !$Is_VMS; + my $installlib = $installprivlib; if ($dir =~ /^auto/ || ($name =~ /^(.*)\.(?:pm|pod)$/ && $archpms{$1}) || ($name =~ /^(.*)\.(?:h|lib)$/i && ($Is_W32 || $Is_NetWare)) || - $name eq 'Config_heavy.pl' + $name=~/^Config_(heavy\|git)\.pl\z/ ) { $installlib = $installarchlib; return unless $do_installarchlib; @@ -754,7 +766,7 @@ sub installlib { unlink("$installarchlib/$name"); } my $xname = "$installlib/$name"; - $xname =~ s/^\Q$opts{destdir}\E// if $opts{destdir}; + $xname =~ s/^\Q$opts{destdir}\E//; $packlist->{$xname} = { type => 'file' }; if ($force || compare($_, "$installlib/$name") || $opts{notify}) { unlink("$installlib/$name"); @@ -801,7 +813,7 @@ sub copy_if_diff { my($from,$to)=@_; return 1 if (($^O eq 'VMS') && (-d $from)); my $xto = $to; - $xto =~ s/^\Q$opts{destdir}\E// if $opts{destdir}; + $xto =~ s/^\Q$opts{destdir}\E//; my $perlpodbadsymlink; if ($from =~ m!^pod/perl[\w-]+\.pod$! && -l $from &&