From: apeiron Date: Sun, 21 Feb 2010 11:59:32 +0000 (+0000) Subject: More robust handling of running new toolchains on older perls. This should sort X-Git-Tag: 1.006009~45 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Flocal-lib.git;a=commitdiff_plain;h=1c9cde8ea186150ec281586cc0685641d205ea27;hp=4b25534dff295b1317d0156824a25a55038a1684 More robust handling of running new toolchains on older perls. This should sort out issues users have with bootstrapping on e.g. Solaris and other traditional Unices. In addition, try to find a GNU tar capable of dealing with @LongLink so bootstrapping doesn't fail. git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@8781 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/Changes b/Changes index 5a4341c..90025ff 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for local::lib + - More robust handling of running new toolchains on older perls. This + should sort out issues users have with bootstrapping on e.g. Solaris + and other traditional Unices. In addition, try to find a GNU tar + capable of dealing with @LongLink so bootstrapping doesn't fail. + - Warnings for missing PATH/PERL5LIB (as when not running interactively) silenced by a patch from Marco Emilio Poleggi. diff --git a/Makefile.PL b/Makefile.PL index acb2ffb..8c4802b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -5,6 +5,37 @@ use Cwd; use vars qw($bootstrapping $bootstrapping_args $no_manpages); use Config; +# Solaris (and possibly other Unices) have a tar in /usr/bin that, among +# other things, does not understand @LongLink. This can cause +# extraction to look like it succeeded, but it actually failed (because +# the error message for the @LongLink failure scrolled offscreen). +# Therefore, given the fact that GNU tar is the most widespread tar available, +# and it actually supports the feature we want (I'd bet it originated in GNU +# tar, but I digress), we'll look for GNU tar. If we don't find it, and the +# user hasn't pointed us to a suitable tar, we'll bomb and tell them what to +# do. + +my $have_gtar = 0; +if($^O eq 'solaris') { + $have_gtar = 0; + for my $env_path (split /:/, $ENV{PATH}) { + $have_gtar = 1 if -x File::Spec->catfile($env_path, 'gtar'); + } +} else { + $have_gtar = 1; +} +if(exists $ENV{PERL_LL_TAR}) { + $have_gtar ||= -x $ENV{PERL_LL_TAR}; +} + +die <<'DEATH' unless $has_gtar; +You are using Solaris (or another traditional Unix) that does not provide a sane +tar, capable of dealing with the output of GNU tar. Please either set the +PERL_LL_TAR environment variable to the location of a version of tar that +understands the @LongLink convention or put a binary named gtar somewhere on +your PATH. +DEATH + my $cwd; BEGIN { $cwd = Cwd::cwd(); @@ -47,6 +78,10 @@ DEATH push(@ARGV,$ENV{PERL_MM_OPT}); push(@ARGV, @libs); + # GODDAMN makepl_arg INSTALLDIRS=site + # we must set PERL_AUTOINSTALL_PREFER_CPAN too + $ENV{PERL_AUTOINSTALL_PREFER_CPAN} = 1; + system($^X, '-MExtUtils::MakeMaker 6.31', '-e1'); my $eumm = $? >> 8; @@ -67,6 +102,18 @@ DEATH } return $orig->(@_); }; + $CPAN::Config->{urllist} = ["http://cpan.shadowcatprojects.net"]; + # all bootstrapped fine on one DH account + # on another, it tries to install man stuff into /usr/local + # cannot for the life of me figure out why + # (same fucking server as well) + # GOT THE BASTARD + # ExtUtils::ParseXS uses Module::Build + # but Module::Build depends on it + # so you need to set prefer_installer MM + # so cpan uses EU::ParseXS' Makefile.PL + # since we already got EUMM, *that* works + $CPAN::Config->{prefer_installer} = "EUMM"; CPAN::Config->load; unless ($done || -w $CPAN::Config->{keep_source_where}) { my $save = $CPAN::Config->{urllist};