Commit c831ead6 authored by Timo Teräs's avatar Timo Teräs
Browse files

state: fix generation of change-set to honour dependencies

parent 3755e1cd
......@@ -253,13 +253,17 @@ int apk_state_satisfy_name(struct apk_state *state,
}
apk_state_set(state, preferred->id, APK_STATE_INSTALL);
r = apk_state_satisfy_deps(state, preferred->depends);
if (r != 0)
return r;
if (preferred != installed) {
r = apk_state_add_change(state, installed, preferred);
if (r != 0)
return r;
}
return apk_state_satisfy_deps(state, preferred->depends);
return 0;
}
int apk_state_satisfy_deps(struct apk_state *state,
......@@ -271,7 +275,7 @@ int apk_state_satisfy_deps(struct apk_state *state,
if (deps == NULL)
return 0;
for (i = 0; i < deps->num; i++) {
for (i = deps->num - 1; i >= 0; i--) {
name = deps->item[i].name;
if (name->pkgs == NULL) {
apk_error("No providers for '%s'", name->name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment