Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Upgrading CPAN - Yes We Can

by ambrus (Abbot)
on Jun 04, 2009 at 15:15 UTC ( #768465=note: print w/replies, xml ) Need Help??


in reply to Upgrading CPAN - Yes We Can

If you're collecting features you'd want, could you add alternate (disjunctive) module dependencies, where a module can depend on different combinations of other modules (and module versions)? The current dependency system is a bit restrictive, apt and other package managers have had disjunctions for ages. Also, maybe there could be recommended and suggested dependencies, not just required ones.

Replies are listed 'Best First'.
Re^2: Upgrading CPAN - Yes We Can
by jdrago_999 (Hermit) on Jun 04, 2009 at 16:03 UTC
    could you add alternate (disjunctive) module dependencies, where a module can depend on different combinations of other modules (and module versions)?

    This is Perl. Of course we can :P

    Actually I'm sure that it's possible simply by extending the grammar or perhaps even with something like this:

    use any(qw( ModuleA ModuleB ModuleC ));

      No, I mean dependencies the CPAN installer handles, so that when a module is installed it installs all the dependencies as well. (There are two varieties of these: dependencies that are only needed for building and that need to be permanently installed, but that is irrelevant now.)

      The difficult part with these is that you don't want to make everyone update their CPAN package, so the only way this could go is that the info file of new modules can contain both the old style dependencies (which is just a plain conjunction of versioned modules) and new style ones. However, as ExtUtils::MakeMaker generates the info file from Makefile.PL, it could also write a sensible default for the old style if you give a dependency expression that has disjunctions in it.

        I don't think I understand what you are saying.

        Are you talking about (for example) if you use Module::Install how you can say:

        requires 'My::Module' => 1.02;

        ...or...

        test_requires 'My::Module' => 1.02;

        ...but not:

        requires_any => ( 'My::Module' => 1.02, 'My::OtherModule' => 2.33, );

        I suppose that the requires_any kind of logic could be implemented simply as a Module::Install plugin.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://768465]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2022-10-01 04:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (126 votes). Check out past polls.

    Notices?