Project

General

Profile

action #108120

Updated by tinita almost 3 years ago

## 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](https://github.com/openSUSE/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

Back