summaryrefslogtreecommitdiff
path: root/src/evr.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-02-22 13:24:36 +0100
committerMichael Schroeder <mls@suse.de>2012-02-22 13:24:36 +0100
commitdc62cb2ebf49314da629de9fa4e0bb1fb47c3451 (patch)
tree8e84549c19584a12325f12af66792303a413a1bb /src/evr.c
parent9719138694aecbc578cc2bb3c8ea02ce1bc8fea5 (diff)
downloadlibsolv-dc62cb2ebf49314da629de9fa4e0bb1fb47c3451.tar.gz
libsolv-dc62cb2ebf49314da629de9fa4e0bb1fb47c3451.tar.bz2
libsolv-dc62cb2ebf49314da629de9fa4e0bb1fb47c3451.zip
- adapt to rpm changes regarding cornercases where the release is missing
Diffstat (limited to 'src/evr.c')
-rw-r--r--src/evr.c9
1 files changed, 8 insertions, 1 deletions
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;
}