Commit 4a21764e authored by Timo Teräs's avatar Timo Teräs

state: fix deletion of obsoleted dependencies

In addition to autocleaning dependencies on deletion, we need to
autoclean the old package on upgrade too. This is to make sure that
obsoleted dependencies (existed previously, but not in new package)
are removed where appropriate.
parent fe55da70
......@@ -749,11 +749,12 @@ int apk_state_commit(struct apk_state *state,
list_for_each_entry(change, &state->change_list_head, change_list) {
numpkg++;
if (change->newpkg == NULL) {
apk_state_autoclean(state, change->oldpkg);
if (change->oldpkg->name->flags & APK_NAME_TOPLEVEL)
toplevel = TRUE;
} else
deleteonly = FALSE;
if (change->oldpkg != NULL)
apk_state_autoclean(state, change->oldpkg);
apk_count_change(change, &prog.total);
if (change->newpkg)
size_diff += change->newpkg->installed_size;
......
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