On Wed, Jan 28, 2009 at 3:46 PM, Eric Wilhelm <[email protected]> wrote:

>
> I think none of the clients currently support the dynamic_config => 0
> flag.  If this flag is true (or missing), the META.yml requires &c are
> defined as "unknowable" without running Build.PL.  What is also missing
> from the current process is to for Build.PL to write a MYMETA.yml based
> on what it computed for the current machine.
>

CPAN.pm supports dynamic_config.  CPANPLUS does not.


>
> >Programatically, it would probably need to be something like this:
> >
> >  maybe_requires( $module, $condition );
> >
> >Then $module would get put in maybe_requires in META.yml, but in
> > requires in MYMETA.yml if $condition is true.
>
> I think this sort of thing will have good uses in the declarative form
> (METAbefore.yml?), but I'm not sure about trying to fit it directly
> into META.yml.
>

It wouldn't go into META.yml -- it would be in Build.PL.  And I suppose it
still needs a version number.  So from this:

    requires => {
      'perl' => 5.006,
      'Sub::Uplevel' => 0,
      ( $^O eq 'MSWin32' ? ( 'Win32API::File' => 0.11 ) : () ),
    }

To this:

    requires => {
      'perl' => 5.006,
      'Sub::Uplevel' => 0,
    },
    maybe_requires => {
      'Win32API::File' => [ 0.11, $^O eq 'MSWin32' ]
    }

Then when Build.PL is run, if the condition is satisfied, Win32API::File
would get included among requirements, but when META.yml is generated, it's
included in the 'maybe_requires' section, not the 'requires' section.

-- David

Reply via email to