From f94dbf969f5cae57925fe64de1639c95b6a62e6c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 24 Apr 2020 08:48:05 +0200 Subject: fix comparing version when using a fixup rpm release force using a version object rationale: - 4.12.0.2 < 4.12.90 will wrongly pass - v4.12.0.2 < 4.12.90 will check as we expect Thus fixing detecting rpm version so that we do compile with rpm < 4.13 See eg: http://www.cpantesters.org/cpan/report/315efa38-85f8-11ea-adf4-f9341f24ea8f --- RPM4/NEWS | 1 + RPM4/src/Makefile.PL | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RPM4/NEWS b/RPM4/NEWS index 86a4789..9851123 100644 --- a/RPM4/NEWS +++ b/RPM4/NEWS @@ -1,3 +1,4 @@ +- fix comparing version when using a fixup rpm release such as 4.12.0.2 - fix detecting unlisted rpm versions - skip installsrpm tests on FreeBSD < 10 diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL index 89dc752..8aacf15 100644 --- a/RPM4/src/Makefile.PL +++ b/RPM4/src/Makefile.PL @@ -4,6 +4,7 @@ use ExtUtils::MakeMaker; use ExtUtils::PkgConfig; use Getopt::Long; +use version; my $rpmv; GetOptions( @@ -40,7 +41,8 @@ foreach (qw( 4.15.0 )) { my $v = $_; - $rpmv < $v and last; + my $vobj = version->declare("v$_"); + $rpmv < $vobj and last; $v =~ s/\./_/g; print $FH "#define RPM$v\n"; $rpmv =~ /^\Q$_/ and last; -- cgit v1.2.1