diff options
Diffstat (limited to 'src/solver.c')
-rw-r--r-- | src/solver.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/solver.c b/src/solver.c index 2c507cb..8f9e724 100644 --- a/src/solver.c +++ b/src/solver.c @@ -897,6 +897,12 @@ static int free_package(apk_hash_item item, void *ctx) return 0; } +static int cmp_pkgname(const void *p1, const void *p2) +{ + const struct apk_dependency *d1 = p1, *d2 = p2; + return strcmp(d1->name->name, d2->name->name); +} + int apk_solver_solve(struct apk_database *db, unsigned short solver_flags, struct apk_dependency_array *world, @@ -907,6 +913,8 @@ int apk_solver_solve(struct apk_database *db, struct apk_solver_state ss_data, *ss = &ss_data; struct apk_dependency *d; + qsort(world->item, world->num, sizeof(world->item[0]), cmp_pkgname); + restart: memset(ss, 0, sizeof(*ss)); ss->db = db; |