sort world dependencies alphabetically
this makes 'lbu diff' and aaudit diffs nice when a world dependency is added or removed. sorting also makes the ordering more deterministic as the world targets constraints are always applied in the same order. test suite updated accordingly.cute-signatures
parent
cd6786bc30
commit
cab03b6912
|
@ -897,6 +897,12 @@ static int free_package(apk_hash_item item, void *ctx)
|
||||||
return 0;
|
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,
|
int apk_solver_solve(struct apk_database *db,
|
||||||
unsigned short solver_flags,
|
unsigned short solver_flags,
|
||||||
struct apk_dependency_array *world,
|
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_solver_state ss_data, *ss = &ss_data;
|
||||||
struct apk_dependency *d;
|
struct apk_dependency *d;
|
||||||
|
|
||||||
|
qsort(world->item, world->num, sizeof(world->item[0]), cmp_pkgname);
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
memset(ss, 0, sizeof(*ss));
|
memset(ss, 0, sizeof(*ss));
|
||||||
ss->db = db;
|
ss->db = db;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
--test-repo installif1.repo
|
--test-repo installif1.repo
|
||||||
add foo app
|
add foo app
|
||||||
@EXPECT
|
@EXPECT
|
||||||
(1/4) Installing foo (1)
|
(1/4) Installing lib (1)
|
||||||
(2/4) Installing lib (1)
|
(2/4) Installing app (1)
|
||||||
(3/4) Installing app (1)
|
(3/4) Installing foo (1)
|
||||||
(4/4) Installing appiif1 (1)
|
(4/4) Installing appiif1 (1)
|
||||||
OK: 0 MiB in 0 packages
|
OK: 0 MiB in 0 packages
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
--test-repo installif1.repo
|
--test-repo installif1.repo
|
||||||
add foo app bar
|
add foo app bar
|
||||||
@EXPECT
|
@EXPECT
|
||||||
(1/6) Installing foo (1)
|
(1/6) Installing lib (1)
|
||||||
(2/6) Installing lib (1)
|
(2/6) Installing app (1)
|
||||||
(3/6) Installing app (1)
|
(3/6) Installing bar (1)
|
||||||
(4/6) Installing appiif1 (1)
|
(4/6) Installing appiif2 (1)
|
||||||
(5/6) Installing bar (1)
|
(5/6) Installing foo (1)
|
||||||
(6/6) Installing appiif2 (1)
|
(6/6) Installing appiif1 (1)
|
||||||
OK: 0 MiB in 0 packages
|
OK: 0 MiB in 0 packages
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
--test-repo installif2.repo
|
--test-repo installif2.repo
|
||||||
add foo app
|
add foo app
|
||||||
@EXPECT
|
@EXPECT
|
||||||
(1/4) Installing foo (1)
|
(1/4) Installing lib (1)
|
||||||
(2/4) Installing lib (1)
|
(2/4) Installing app (1)
|
||||||
(3/4) Installing app (1)
|
(3/4) Installing foo (1)
|
||||||
(4/4) Installing appiif1 (1)
|
(4/4) Installing appiif1 (1)
|
||||||
OK: 0 MiB in 0 packages
|
OK: 0 MiB in 0 packages
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
--test-repo provides.repo
|
--test-repo provides.repo
|
||||||
add mymailreader mailreadplus
|
add mymailreader mailreadplus
|
||||||
@EXPECT
|
@EXPECT
|
||||||
(1/2) Installing mymailreader (1)
|
(1/2) Installing mailreadplus (1)
|
||||||
(2/2) Installing mailreadplus (1)
|
(2/2) Installing mymailreader (1)
|
||||||
OK: 0 MiB in 0 packages
|
OK: 0 MiB in 0 packages
|
||||||
|
|
Loading…
Reference in New Issue