summaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-05-27 11:34:17 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-05-27 11:34:17 +0300
commit4a21764ee110c46dea75be85eb7a55cd60fab819 (patch)
tree38596ee17a1059e6b6515dc0fb43a70701cf6d5d /src/state.c
parentfe55da70741621f7bac2cd943b64cc13e25f9427 (diff)
downloadapk-tools-4a21764ee110c46dea75be85eb7a55cd60fab819.tar.gz
apk-tools-4a21764ee110c46dea75be85eb7a55cd60fab819.tar.bz2
apk-tools-4a21764ee110c46dea75be85eb7a55cd60fab819.tar.xz
apk-tools-4a21764ee110c46dea75be85eb7a55cd60fab819.zip
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.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c3
1 files changed, 2 insertions, 1 deletions
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;