miyagawa / cpanminus

cpanminus - get, unpack, build and install modules from CPAN
http://cpanmin.us
755 stars 213 forks source link

cpanm not respecting version spec #582

Closed djjudas21 closed 6 years ago

djjudas21 commented 6 years ago

After a running into a bug with DBD::mysql 4.047 I needed to pin to an older version.

Relevant snippet from my cpanfile:

requires 'DBD::mysql', '4.046';

Output from cpanm:

cpanm --verbose --installdeps --notest .
...
Searching DBD::mysql (4.046) on cpanmetadb ...
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.047.tar.gz ... OK
Unpacking DBD-mysql-4.047.tar.gz
DBD-mysql-4.047/
...

Why does it correctly specify 4.046 and then go on to fetch 4.047 anyway?

Full output from Jenkins CI available here

miyagawa commented 6 years ago

You can use '== 4.046' to do what you mean.

'4.046' means "at a minimum 4.046" per CPAN::Meta::Spec: https://metacpan.org/pod/CPAN::Meta::Spec#Version-Ranges

eserte commented 5 years ago

Actually in this situation '!=4.047' would be the correct solution --- or better said, the optimistic solution, in the hope that the next release fixes the problem.