Re: [Module-build-general] [PATCH] Make Compat.pm play well with old CPAN(PLUS)?.pm.
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <ke...@ma...> - 2002-08-16 07:22:51
|
On Thursday, August 15, 2002, at 08:57 PM, Autrijus Tang wrote: > As attached. Two things are fixed: > > - PREREQ_PM info is now written to Makefile. > - Friendly bootstrapping code that makes Module::Build to > be installed first. Both good goals. > I hadn't tested extensively whether old CPAN.pm will resume > from 'perl Makefile.PL' step or merely 'make'. If it's > the latter case then we also need a fake 'all :' target > that runs 'Build.PL' again in the POD. A shame that this all has to be in the POD instead of just in the module. I suppose we could create a little utility method that writes out one of these dummy Makefile.PL thingies for the author. > > -sub write_makefile { > - # Note - this doesn't yet emulate the PREREQ_PM stuff. > +sub fake_prereqs { > + my ($pack, %in) = @_; > + $in{metadata} ||= 'META.yaml'; Unfortunately it's not quite right to read the META.yaml file after you run Build.PL, because the answers might have changed (for example, if Build.PL asks the users some questions, or senses its environment, to determine the prereqs). Build.PL doesn't update the META.yaml file, because the user might not have YAML installed - and that file isn't supposed to change from one user's machine to another, either. I think what's required is for the create_build_script() method to write a file, say _build/prereq, that can be read later. > + while (<META>) { > + next if (1 .. /^$section:$/); Nice flip-flop. =) -Ken |