cpm
cpm copied to clipboard
install by url fails when same dist required with different version
To support our private Perl dist repo we use the url feature or cpanfile, e.g.
requires 'Our::Dist' => '1.23',
url => 'http://fqdn/Our-Dist-1.23.tar.gz';
When a private dependency has the same dependency but with a different version installation fails. For example
cpanfile of Our-Dist-A:
requires 'Our::Dist::B' => '1.0',
url => 'http://fqdn/Our-Dist-B-1.0.tar.gz';
requires 'Our::Dist::C' => '1.23',
url => 'http://fqdn/Our-Dist-C-1.23.tar.gz';
cpanfile of Our-Dist-B:
requires 'Our::Dist::C' => '1.24',
url => 'http://fqdn/Our-Dist-C-1.24.tar.gz';
output of cpm install -g in Our-Dist-A directory:
WARN http://fqdn/Our-Dist-C-1.23.tar.gz provides Our::Dist::C (1.23), but needs 1.24
FAIL install http://fqdn/Our-Dist-B-1.0.tar.gz
At the moment, If you have multiple private distributions, I suggest you prepare DarkPAN.
Then use cpm with --resolver 02packages,http://your-darkpan (and optionally with --resolver metadb too).
We use CPANPLUS custom sources feature because it's easy to use and only requires a single text file containing all filenames. Setting up a DarkPAN server is much more work.
Something similar happens when DarkPAN dist A requires DarkPAN dist B and lists its URL in the cpanfile. The cpanfile of DarkPAN dist B in turn also lists DarkPAN dist C with its URL which can't be resolved.