summaryrefslogtreecommitdiff
path: root/src/policy.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2018-11-30 12:40:15 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2018-11-30 12:40:16 +0900
commit51a3a2ac14ea0b18ccbe47ce771d5c962aa0800a (patch)
tree778194706f6f8a417899f6070be7308107bc92bb /src/policy.c
parent22e701e553344eeb22f88ed0906d76c9a5e39d83 (diff)
downloadlibsolv-51a3a2ac14ea0b18ccbe47ce771d5c962aa0800a.tar.gz
libsolv-51a3a2ac14ea0b18ccbe47ce771d5c962aa0800a.tar.bz2
libsolv-51a3a2ac14ea0b18ccbe47ce771d5c962aa0800a.zip
Imported Upstream version 0.6.25upstream/0.6.25
Change-Id: I4c41182d0968927b2dc78980b41c0b7c2e931a4a Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'src/policy.c')
-rw-r--r--src/policy.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/policy.c b/src/policy.c
index 7ed52d9..8b4c2e4 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -981,23 +981,7 @@ sort_by_name_evr_sortcmp(const void *ap, const void *bp, void *dp)
return 0;
a = aa[2] < 0 ? -aa[2] : aa[2];
b = bb[2] < 0 ? -bb[2] : bb[2];
- if (pool->disttype != DISTTYPE_DEB && a != b)
- {
- /* treat release-less versions different */
- const char *as = pool_id2str(pool, a);
- const char *bs = pool_id2str(pool, b);
- if (strchr(as, '-'))
- {
- if (!strchr(bs, '-'))
- return -2;
- }
- else
- {
- if (strchr(bs, '-'))
- return 2;
- }
- }
- r = pool_evrcmp(pool, b, a, EVRCMP_COMPARE);
+ r = pool_evrcmp(pool, b, a, pool->disttype != DISTTYPE_DEB ? EVRCMP_MATCH_RELEASE : EVRCMP_COMPARE);
if (!r && (aa[2] < 0 || bb[2] < 0))
{
if (bb[2] >= 0)
@@ -1005,9 +989,7 @@ sort_by_name_evr_sortcmp(const void *ap, const void *bp, void *dp)
if (aa[2] >= 0)
return -1;
}
- if (r)
- return r < 0 ? -1 : 1;
- return 0;
+ return r;
}
/* common end of sort_by_srcversion and sort_by_common_dep */