From 4a21764ee110c46dea75be85eb7a55cd60fab819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Thu, 27 May 2010 11:34:17 +0300 Subject: 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. --- src/state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/state.c b/src/state.c index 7de9259..9204228 100644 --- a/src/state.c +++ b/src/state.c @@ -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; -- cgit v1.2.3