action #108120
openrpm and cpanspec: Support vx.y versions in perl modules
0%
Description
Observation¶
When a module specifies its version like this:
use version; our $VERSION = qv("v1.3.0");
(e.g. https://metacpan.org/release/EGILES/Test-Compile-v1.3.0/source/lib/Test/Compile.pm)
then the rpm package will get a Provides: perl(Test::Compile)
entry without a version.
The script responsible for that is perl.prov
:
https://github.com/rpm-software-management/rpm/blob/master/scripts/perl.prov
On the other end cpanspec also doesn't remove the v
from the BuildRequires
and Requires
entries. (Note that it does get removed from the package version,
e.g. we have perl-Test-Compile-3.0.1-28.28.noarch.rpm
.)
Problem 1¶
If a package has Provides: perl(Test::Compile)
without a version then a Requires: perl(Test::Compile) >= 999999
will always succeed.
So currently we can't guarantee that our Requires
entries are doing what we expect.
Problem 2¶
cpanspec has to remove the v
also because Requires: perl(...) >= vx.y
also won't work, even if the Provides entry is correct.
Example¶
% rpm -q --provides perl-YAML-PP-0.031-lp153.2.1.noarch
perl(YAML::PP) = 0.031
perl(YAML::PP::Common) = 0.031
perl(YAML::PP::Constructor) = 0.031
perl(YAML::PP::Dumper) = 0.031
perl(YAML::PP::Emitter) = 0.031
perl(YAML::PP::Exception) = 0.031
...
% rpm -q --provides perl-Test-Compile-1.3.0-bp153.1.12.noarch
perl(Test::Compile)
perl(Test::Compile::Internal)
perl-Test-Compile = 1.3.0-bp153.1.12
Suggestions¶
- Add parsing versions like
qv("v1.3.0");
to perl.prov - Alternatively add
Provides:
entries to the .spec via cpanspec in such cases - Fix cpanspec to remove the leading v for (Build)Requires entries
Updated by tinita almost 3 years ago
- Copied from action #92122: Improve dependency detection via MYMETA.json in cpanspec added
Updated by okurz almost 3 years ago
As you created a separate ticket I assume you did that so that you can conclude #92122 more easily. So does this need to be in our backlog?
Updated by okurz almost 3 years ago
- Due date deleted (
2022-03-17) - Target version changed from Ready to future
- Start date deleted (
2021-05-04)
I assume the answer to #/108120#note-4 is no for now.