From dc62cb2ebf49314da629de9fa4e0bb1fb47c3451 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 22 Feb 2012 13:24:36 +0100 Subject: - adapt to rpm changes regarding cornercases where the release is missing --- src/evr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/evr.c') diff --git a/src/evr.c b/src/evr.c index c8cc940..a209e65 100644 --- a/src/evr.c +++ b/src/evr.c @@ -225,9 +225,16 @@ pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode) return 0; if (r1 && r2) { - if (s1 != ++r1 && s2 != ++r2) + if (mode != EVRCMP_MATCH || (s1 != ++r1 && s2 != ++r2)) r = solv_vercmp(r1, s1, r2, s2); } + else if (mode == EVRCMP_MATCH_RELEASE) + { + if (!r1 && r2) + return -2; + if (r1 && !r2) + return 2; + } return r; } -- cgit v1.2.3