You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of managing a large dependency tree at work, we have a need to merge multiple cpanfiles together into a single (large) dependency list.
For the most part, this works beautifully, but I have encountered one scenario which provides sub-optimal results...
... when merging 2x dependency lists together where the first has no explicit versioning provided (and so it just cares "do we have it installed at all?"), and the second has an explicit maximum version requirement.
Rather than getting a result similar to < 2.0, we instead get one of >= 0, < 2.0.
While I understand that syntactically this makes sense ("make sure it's installed, and make sure that it has a version number less than 2.0"), it also feels duplicative and wasteful (as the maximum version requirement already implies that the module is installed).
I have attached 2x scripts here to demonstrate this.
cpan-meta-prereqs-cpanfile.pl.txt ... a script which dumps out 2x temporary cpanfile files, and then loads/merges them together, outputting the resulting dependency tree.
cpan-meta-prereqs.pl.txt ... a lower-level script using justCPAN::Meta::Prereqs (instead of Module::CPANfile), which demonstrates same resulting dependency tree
The text was updated successfully, but these errors were encountered:
As part of managing a large dependency tree at work, we have a need to merge multiple
cpanfile
s together into a single (large) dependency list.For the most part, this works beautifully, but I have encountered one scenario which provides sub-optimal results...
... when merging 2x dependency lists together where the first has no explicit versioning provided (and so it just cares "do we have it installed at all?"), and the second has an explicit maximum version requirement.
Rather than getting a result similar to
< 2.0
, we instead get one of>= 0, < 2.0
.While I understand that syntactically this makes sense ("make sure it's installed, and make sure that it has a version number less than 2.0"), it also feels duplicative and wasteful (as the maximum version requirement already implies that the module is installed).
I have attached 2x scripts here to demonstrate this.
cpan-meta-prereqs-cpanfile.pl.txt ... a script which dumps out 2x temporary
cpanfile
files, and then loads/merges them together, outputting the resulting dependency tree.cpan-meta-prereqs.pl.txt ... a lower-level script using just
CPAN::Meta::Prereqs
(instead ofModule::CPANfile
), which demonstrates same resulting dependency treeThe text was updated successfully, but these errors were encountered: