remove reverse dependencies first

when removing large sets of packets, the ordering of removal
was not quaranteed to honor dependencies. this fixes the removal
order to be in reverse dependency order as far as possible.
cute-signatures
Timo Teräs 2015-01-30 12:27:31 +00:00
parent 02cd5a9c76
commit 0276e22731
1 changed files with 6 additions and 0 deletions

View File

@ -802,6 +802,11 @@ static void cset_gen_name_change(struct apk_solver_state *ss, struct apk_name *n
cset_track_deps_removed(ss, opkg);
}
static void cset_gen_name_remove0(struct apk_package *pkg0, struct apk_dependency *dep0, struct apk_package *pkg, void *ctx)
{
cset_gen_name_remove(ctx, pkg0);
}
static void cset_gen_name_remove(struct apk_solver_state *ss, struct apk_package *pkg)
{
struct apk_name *name = pkg->name, **pname;
@ -813,6 +818,7 @@ static void cset_gen_name_remove(struct apk_solver_state *ss, struct apk_package
name->ss.in_changeset = 1;
pkg->ss.in_changeset = 1;
apk_pkg_foreach_reverse_dependency(pkg, APK_FOREACH_INSTALLED|APK_DEP_SATISFIES, cset_gen_name_remove0, ss);
foreach_array_item(pname, pkg->name->rinstall_if)
cset_check_removal_by_iif(ss, *pname);
record_change(ss, pkg, NULL);