From 0276e227315f9ef94843d3bcf7f564221b150f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 30 Jan 2015 12:27:31 +0000 Subject: 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. --- src/solver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/solver.c b/src/solver.c index d83bb6a..2c507cb 100644 --- a/src/solver.c +++ b/src/solver.c @@ -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); -- cgit v1.2.3