aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-01-30 12:27:31 +0000
committerTimo Teräs <timo.teras@iki.fi>2015-01-30 14:30:15 +0200
commit0276e227315f9ef94843d3bcf7f564221b150f26 (patch)
tree7284f0785e3dad62eaa1749729cd80fb30c0bf27
parent02cd5a9c76cd676545c232bb567d7eb01e5bd6fd (diff)
downloadapk-tools-0276e227315f9ef94843d3bcf7f564221b150f26.tar.bz2
apk-tools-0276e227315f9ef94843d3bcf7f564221b150f26.tar.xz
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.
-rw-r--r--src/solver.c6
1 files changed, 6 insertions, 0 deletions
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);