Skip Menu |
 

This queue is for tickets about the Module-Install CPAN distribution.

Report information
The Basics
Id: 64214
Status: open
Priority: 0/
Queue: Module-Install

People
Owner: Nobody in particular
Requestors: florent.angly [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.00
Fixed in: (no value)



Subject: Require one out of several dependencies
Download (untitled) / with headers
text/plain 944b
Sometimes, there are several ways to do one thing and you want to give the user the flexibility to use any one of those. Currently, using 'requires' or 'requires_external_bin', there is no way to specify that one requires only one program or module out of several ones. Consider that my script needs the dependencies A, B or C. I can write: requires_external_bin 'A'; requires_external_bin 'B'; requires_external_bin 'C'; But that forces the user to have A, B, and C installed, when only one of them is needed. I could also write: requires_external_bin 'A'; But that is forcing the user to have A installed, whereas he may only be interested in using B or C. Ideally, instead of 'requires_external_bin', I would like to use something like: requires_external_bin_any ('A','B','C'); The user would be required to provide only A, B or C. Similarly, it may be valuable to use a similar mechanism for 'requires', e,g, 'requires_any'.
Download (untitled) / with headers
text/plain 1.1k
I noticed today that one way to do what I describe above is to use the 'feature' option, described (very briefly) at http://search.cpan.org/dist/Module-Install/lib/Module/AutoInstall.pm#Prerequisites_and_Features If I had three Perl modules that provided the same function, I would write that I need only one of these this way: feature 'FeatureA', -default => 1, 'ModuleA' => 0; feature 'FeatureB', -default => 0, 'ModuleB' => 0; feature 'FeatureC', -default => 0, 'ModuleC' => 0; However, this method is limited to Perl modules only, and does not work to specify external dependencies. Maybe it could be modified to take this sort of syntax? feature 'FeatureA', -default => 1, -module => [ 'ModuleA' => 0 ], -external_bin => [ 'BinA' => 0 ]; feature 'FeatureB', -default => 0, -module => [ 'ModuleB' => 0 ], -external_bin => [ 'BinB' => 0 ]; feature 'FeatureC', -default => 0, -module => [ 'ModuleC' => 0 ], -external_bin => [ 'BinC' => 0 ];


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.