Re: [Module-build-general] A better passthrough Makefile.PL
Status: Beta
Brought to you by:
kwilliams
|
From: Dave R. <au...@ur...> - 2002-11-01 07:12:54
|
On Thu, 31 Oct 2002, Ken Williams wrote:
> I think this is a decent change. Autrijus, I think it's better to use
> ExtUtils::MakeMaker here than ExtUtils::AutoInstall, simply because the
> user will have the former but probably not the latter.
>
> Actually, I just had an idea - would the following small change work
> (note the 'touch' line, "open $0")?
>
> unless (eval "use Module::Build::Compat 0.02; 1" ) {
> # Workaround with old CPAN.pm and CPANPLUS.pm
> require ExtUtils::MakeMaker;
> ExtUtils::MakeMaker::WriteMakefile(
> PREREQ_PM => { 'Module::Build::Compat' => 0.02 }
> );
> warn "Warning: prerequisite Module::Build::Compat is not found.\n";
> sleep 2; # Wait a couple seconds after writing Makefile
> open my($fh), ">> $0" # Change modification date
> or warn "You may have to run 'perl Makefile.PL' again.";
> exit(0);
> }
> Module::Build::Compat->run_build_pl(args => \@ARGV);
> Module::Build::Compat->write_makefile();
>
> The idea is that it changes the modification time for Makefile.PL to be
> after the Makefile's, so that Makefile.PL gets re-run. This is kind of
> tough to test out - Dave, how did you test this before?
I tested this by uploading a module to CPAN with this Makefile.PL
(Thesaurus 0.21) and installing it. Very elegant ;)
FWIW, it did work quite well. I think your change above may work just as
well. If anyone knows of a way to force CPAN to install something from a
tarball (as opposed to fetching the tarball from elsewhere), that'd be
very helpful in testing this sort of stuff.
-dave
/*==================
www.urth.org
we await the New Sun
==================*/
|