summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-04-24 08:48:05 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-04-24 11:17:55 +0200
commitf94dbf969f5cae57925fe64de1639c95b6a62e6c (patch)
tree405737c46767f78262d72a72d449e987f2428e68
parent06969c88d338c6c00c42e9edfd5435436c520ccd (diff)
downloadperl-RPM4-f94dbf969f5cae57925fe64de1639c95b6a62e6c.tar
perl-RPM4-f94dbf969f5cae57925fe64de1639c95b6a62e6c.tar.gz
perl-RPM4-f94dbf969f5cae57925fe64de1639c95b6a62e6c.tar.bz2
perl-RPM4-f94dbf969f5cae57925fe64de1639c95b6a62e6c.tar.xz
perl-RPM4-f94dbf969f5cae57925fe64de1639c95b6a62e6c.zip
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
-rw-r--r--RPM4/NEWS1
-rw-r--r--RPM4/src/Makefile.PL4
2 files changed, 4 insertions, 1 deletions
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;