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
parent
fe55da7074
commit
4a21764ee1
|
@ -749,11 +749,12 @@ int apk_state_commit(struct apk_state *state,
|
||||||
list_for_each_entry(change, &state->change_list_head, change_list) {
|
list_for_each_entry(change, &state->change_list_head, change_list) {
|
||||||
numpkg++;
|
numpkg++;
|
||||||
if (change->newpkg == NULL) {
|
if (change->newpkg == NULL) {
|
||||||
apk_state_autoclean(state, change->oldpkg);
|
|
||||||
if (change->oldpkg->name->flags & APK_NAME_TOPLEVEL)
|
if (change->oldpkg->name->flags & APK_NAME_TOPLEVEL)
|
||||||
toplevel = TRUE;
|
toplevel = TRUE;
|
||||||
} else
|
} else
|
||||||
deleteonly = FALSE;
|
deleteonly = FALSE;
|
||||||
|
if (change->oldpkg != NULL)
|
||||||
|
apk_state_autoclean(state, change->oldpkg);
|
||||||
apk_count_change(change, &prog.total);
|
apk_count_change(change, &prog.total);
|
||||||
if (change->newpkg)
|
if (change->newpkg)
|
||||||
size_diff += change->newpkg->installed_size;
|
size_diff += change->newpkg->installed_size;
|
||||||
|
|
Loading…
Reference in New Issue