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.
cute-signatures
Timo Teräs 2010-05-27 11:34:17 +03:00
parent fe55da7074
commit 4a21764ee1
1 changed files with 2 additions and 1 deletions

View File

@ -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;