summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-04-23 09:36:45 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-04-23 09:39:42 +0200
commitd2693f0078c4a9b6e904ac0b398f4c4eb5be2713 (patch)
tree0a1caa69404984a915325e388e5c6fc14e62dca0
parent25b6749a7b972791c976b0fed36f81336d682fe5 (diff)
downloadperl-RPM4-d2693f0078c4a9b6e904ac0b398f4c4eb5be2713.tar
perl-RPM4-d2693f0078c4a9b6e904ac0b398f4c4eb5be2713.tar.gz
perl-RPM4-d2693f0078c4a9b6e904ac0b398f4c4eb5be2713.tar.bz2
perl-RPM4-d2693f0078c4a9b6e904ac0b398f4c4eb5be2713.tar.xz
perl-RPM4-d2693f0078c4a9b6e904ac0b398f4c4eb5be2713.zip
simplify testing rpm version like URPM does
It's no more needed to list all point version unless there's a change in them we want to test for (such as 4.12.90) Thus fixing detecting unlisted rpm versions such as http://www.cpantesters.org/cpan/report/1d673d18-503a-11ea-8fff-b48f1f24ea8f where 4.13.0.1 wasn't listed and thus choked on rpm >= 4.15 code path set by commit 9e3deaefdbc54910d58dea28d06c2678673c9d09
-rw-r--r--RPM4/NEWS2
-rw-r--r--RPM4/src/Makefile.PL11
2 files changed, 3 insertions, 10 deletions
diff --git a/RPM4/NEWS b/RPM4/NEWS
index 4a127e2..cde70a7 100644
--- a/RPM4/NEWS
+++ b/RPM4/NEWS
@@ -1,3 +1,5 @@
+- fix detecting unlisted rpm versions
+
Version 0.41 - 14 February 2020
- fix detecting rpm-4.15.x final
diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL
index 6dbf55c..009c45c 100644
--- a/RPM4/src/Makefile.PL
+++ b/RPM4/src/Makefile.PL
@@ -33,20 +33,11 @@ print $FH ' * $Id$' . "\n";
print $FH " */\n\n";
print $FH "#ifndef RPMVERSION_H\n#define RPMVERSION_H\n\n";
foreach (qw(
- 4.9.0
- 4.9.1
- 4.9.1.1
- 4.9.1.2
- 4.10.0
- 4.11.0
- 4.11.1
- 4.11.2
- 4.11.3
- 4.12.0
4.12.90
4.15.0
)) {
my $v = $_;
+ $rpmv < $v and last;
$v =~ s/\./_/g;
print $FH "#define RPM$v\n";
$rpmv =~ /^\Q$_/ and last;