summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-11-04 12:13:19 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-11-04 12:13:19 +0200
commit832dfed637eb55ef84182d3ce0a112bd8b828130 (patch)
treecf1f5910522816ec526e4b9812a17909f8b19b4d /src
parent21d391961bfdd78b1b09b14ed4d777d882e929ec (diff)
downloadapk-tools-832dfed637eb55ef84182d3ce0a112bd8b828130.tar.gz
apk-tools-832dfed637eb55ef84182d3ce0a112bd8b828130.tar.bz2
apk-tools-832dfed637eb55ef84182d3ce0a112bd8b828130.tar.xz
apk-tools-832dfed637eb55ef84182d3ce0a112bd8b828130.zip
solver: fix package prefence calculation a bit
Diffstat (limited to 'src')
-rw-r--r--src/solver.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/solver.c b/src/solver.c
index 5d85792..b12fc70 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -413,12 +413,14 @@ static void calculate_pkg_preference(struct apk_package *pkg)
continue;
for (j = 0; j < d0->name->providers->num; j++) {
struct apk_provider *p0 = &d0->name->providers->item[j];
- if (pkg == p0->pkg)
+ if (name == p0->pkg->name)
continue;
if (compare_absolute_package_preference(&p, p0) < 0)
ps->preference++;
}
}
+
+ dbg_printf(PKG_VER_FMT ": preference=%d\n", PKG_VER_PRINTF(pkg), ps->preference);
}
static void count_name(struct apk_solver_state *ss, struct apk_name *name)