Re: [Module-build-general] Some improvement to the pass-thru compat Makefile.PL
Status: Beta
Brought to you by:
kwilliams
|
From: Autrijus T. <aut...@au...> - 2003-02-05 01:53:49
|
On Mon, Feb 03, 2003 at 05:25:02PM -0600, Dave Rolsky wrote:
> On Thu, 19 Dec 2002, Autrijus Tang wrote:
>=20
> > # Check if we're under the non-reentrant CPAN.pm
> > require CPAN;
> > CPAN::Config->load;
> >
> > my $cwd =3D File::Spec->canonpath(Cwd::cwd());
> > my $cpan =3D File::Spec->canonpath($CPAN::Config->{cpan_home});
> > if (index($cwd, $cpan) =3D=3D -1) {
> > print "This module requires Module::Build to install itself=
.\n";
> >
> > $yn =3D ExtUtils::MakeMaker::prompt(
> > ' Install Module::Build from CPAN?', 'y'
> > );
> > }
>=20
> Autrijus, what exactly is this checking? Is it just that the "index"
> check returns -1 only for certain newer versions of CPAN.pm?
Mmm? CPAN.pm is non-reentrant in general, so we cannot use it if we're
under CPAN.pm's installation already. The check is to see that our
cwd() is not under .cpan/.
> And shouldn't this check come _after_ checking for CPANPLUS?
No... Since the only condition our autoinstallation will fail is under
CPAN.pm; CPANPLUS plays well re-entrantly.
/Autrijus/
|