summaryrefslogtreecommitdiff
path: root/src/solver.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-05-30 08:46:30 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-05-30 08:48:32 +0300
commitaec93ee730f7a2e0196ae05fdd45e866d2510e41 (patch)
treeb51fdb4924941ea15eea0356fa6e69a7afc91e14 /src/solver.c
parent035da870362494bcb4ed092e27278c290b204410 (diff)
downloadapk-tools-aec93ee730f7a2e0196ae05fdd45e866d2510e41.tar.gz
apk-tools-aec93ee730f7a2e0196ae05fdd45e866d2510e41.tar.bz2
apk-tools-aec93ee730f7a2e0196ae05fdd45e866d2510e41.tar.xz
apk-tools-aec93ee730f7a2e0196ae05fdd45e866d2510e41.zip
db: unify handling of special packages
make cache a special kind of repository, and automatically cache special packages (virtual packages, or ones installed from command line). add test cases for handling virtual packages. fixes #1617.
Diffstat (limited to 'src/solver.c')
-rw-r--r--src/solver.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/solver.c b/src/solver.c
index f4d1f98..24ee5a9 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -198,14 +198,7 @@ static inline struct apk_package *decision_to_pkg(struct apk_decision *d)
static inline int pkg_available(struct apk_database *db, struct apk_package *pkg)
{
- /* virtual packages - only deps used; no real .apk */
- if (pkg->installed_size == 0)
- return TRUE;
- /* obviously present */
- if (pkg->in_cache || pkg->filename != NULL || (pkg->repos & db->local_repos))
- return TRUE;
- /* can download */
- if ((pkg->repos & ~db->bad_repos) && !(apk_flags & APK_NO_NETWORK))
+ if (pkg->repos & db->available_repos)
return TRUE;
return FALSE;
}
@@ -686,6 +679,7 @@ static inline void assign_name(
(p.version != &apk_null_blob || name->ss.chosen.version != &apk_null_blob)) {
/* Assigning locked name with version is a problem;
* generally package providing same name twice */
+ dbg_printf("%s: re-provided by %s\n", name->name, p.pkg->name->name);
name->ss.locked++;
ss->impossible_state = 1;
return;