summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-04-10 11:10:12 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-04-10 11:10:40 +0300
commitc35086dc927372bcbb260f0ef4b06eca38d9fdc4 (patch)
tree56e3899e1f1fd3960a834e64744e40532052ae41 /src
parent9fa64ca1db84c7a57434498651218d02da57ca04 (diff)
downloadapk-tools-c35086dc927372bcbb260f0ef4b06eca38d9fdc4.tar.gz
apk-tools-c35086dc927372bcbb260f0ef4b06eca38d9fdc4.tar.bz2
apk-tools-c35086dc927372bcbb260f0ef4b06eca38d9fdc4.tar.xz
apk-tools-c35086dc927372bcbb260f0ef4b06eca38d9fdc4.zip
solver: purge install_if packages deleted from repositories on upgrade -a
Diffstat (limited to 'src')
-rw-r--r--src/solver.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/solver.c b/src/solver.c
index 9c513c7..2b35924 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -187,8 +187,6 @@ static void discover_name(struct apk_solver_state *ss, struct apk_name *name)
continue;
pkg->ss.seen = 1;
- pkg->ss.iif_failed = (pkg->install_if->num == 0);
- name->ss.no_iif &= pkg->ss.iif_failed;
pkg->ss.pinning_allowed = APK_DEFAULT_PINNING_MASK;
pkg->ss.pinning_preferred = APK_DEFAULT_PINNING_MASK;
@@ -201,6 +199,15 @@ static void discover_name(struct apk_solver_state *ss, struct apk_name *name)
(pkg->repos & db->available_repos) ||
pkg->ipkg;
+ /* Prune install_if packages that are no longer available,
+ * currently works only if SOLVERF_AVAILABLE is set in the
+ * global solver flags. */
+ pkg->ss.iif_failed =
+ (pkg->install_if->num == 0) ||
+ ((ss->solver_flags_inherit & APK_SOLVERF_AVAILABLE) &&
+ !pkg->ss.pkg_available);
+ name->ss.no_iif &= pkg->ss.iif_failed;
+
repos = get_pkg_repos(db, pkg);
pkg->ss.tag_preferred =
(pkg->filename != NULL) ||