summaryrefslogtreecommitdiff
path: root/src/policy.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2009-05-12 12:23:49 +0200
committerMichael Schroeder <mls@suse.de>2009-05-12 12:23:49 +0200
commita6ea1d8f4f8ffc5bc556fb41c4d6465bb9a76caa (patch)
tree2ff4cd8112d5186ab4c643e97f5f72f089b34997 /src/policy.c
parent8b2723e4eed25ecc3018c9760e9cdf0aade1daf6 (diff)
downloadlibsolv-a6ea1d8f4f8ffc5bc556fb41c4d6465bb9a76caa.tar.gz
libsolv-a6ea1d8f4f8ffc5bc556fb41c4d6465bb9a76caa.tar.bz2
libsolv-a6ea1d8f4f8ffc5bc556fb41c4d6465bb9a76caa.zip
- define solvid2str() function, use sat_sort()
Diffstat (limited to 'src/policy.c')
-rw-r--r--src/policy.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/policy.c b/src/policy.c
index 0bbe7b1..fe5c570 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -22,8 +22,6 @@
#include "poolarch.h"
-static Solver *prune_to_best_version_sortcmp_data;
-
/*-----------------------------------------------------------------*/
/*
@@ -32,9 +30,9 @@ static Solver *prune_to_best_version_sortcmp_data;
*/
static int
-prune_to_best_version_sortcmp(const void *ap, const void *bp)
+prune_to_best_version_sortcmp(const void *ap, const void *bp, void *dp)
{
- Solver *solv = prune_to_best_version_sortcmp_data;
+ Solver *solv = dp;
Pool *pool = solv->pool;
int r;
Id a = *(Id *)ap;
@@ -282,9 +280,8 @@ prune_to_best_version(Solver *solv, Queue *plist)
return;
POOL_DEBUG(SAT_DEBUG_POLICY, "prune_to_best_version %d\n", plist->count);
- prune_to_best_version_sortcmp_data = solv;
/* sort by name first, prefer installed */
- qsort(plist->elements, plist->count, sizeof(Id), prune_to_best_version_sortcmp);
+ sat_sort(plist->elements, plist->count, sizeof(Id), prune_to_best_version_sortcmp, solv);
/* delete obsoleted. hmm, looks expensive! */
/* FIXME maybe also check provides depending on noupdateprovide? */