openSUSE / cpanspec

Create openSUSE spec files form cpan tar files
Other
8 stars 10 forks source link

Read from MYMETA.{json,yml} #33

Closed perlpunk closed 2 years ago

perlpunk commented 2 years ago

Note: I will run this branch for a week or so on the autoupdate host to check if the updates look ok.

Issue: https://progress.opensuse.org/issues/92122

I put the code to read META.{json,yml} into subroutines, so I could reuse the code for MYMETA.

Along the way I did many small refactorings.

Now intrusive.pl and Intrusive.pm are not needed anymore.

perlpunk commented 2 years ago

Actually we do already have modules where we require versions with a leading v:

% ack "BuildRequires:.* v\d"
perl-Class-DBI-Sweet/perl-Class-DBI-Sweet.spec
33:BuildRequires:  perl(Class::DBI) >= v3.0.12

perl-Config-Model/perl-Config-Model.spec
46:BuildRequires:  perl(Parse::RecDescent) >= v1.90.0

perl-Devel-Cover-Report-Codecov/perl-Devel-Cover-Report-Codecov.spec
50:BuildRequires:  perl(Test::Mock::Time) >= v0.1.6

perl-Module-CPANTS-Analyse/perl-Module-CPANTS-Analyse.spec
42:BuildRequires:  perl(File::Find::Object) >= v0.2.1

perl-Net-Stomp/perl-Net-Stomp.spec
39:BuildRequires:  perl(Test::NiceDump) >= v1.0.0

perl-Number-Phone/perl-Number-Phone.spec
37:BuildRequires:  perl(Parallel::ForkManager) >= v0.7.6

perl-Pod-Tree/perl-Pod-Tree.spec
39:BuildRequires:  perl(Test::Compile) >= v1.2.1

perl-Text-Xslate/perl-Text-Xslate.spec
39:BuildRequires:  perl(Mouse) >= v2.5.0

perl-Text-Table-Manifold/perl-Text-Table-Manifold.spec
31:BuildRequires:  perl(Const::Exporter) >= v0.2.3

That is something that cpanspec needs to handle in general, but this PR didn't introduce it, it just revealed the problem. I guess nobody noticed the wrong versions in the other modules so far.

I created the ticket with a detailed explanation and what we could do: https://progress.opensuse.org/issues/108120

So the next step for cpanspec is to remove the leading v (and this is already done for the package version of the perl distribution itself).

I should do this in a seperate PR.