summaryrefslogtreecommitdiffstats
path: root/main/apk-tools/0001-solver-fix-package-prefence-calculation-a-bit.patch
blob: c2b65570598a8466b255f2d2da43f34ffc405e8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 832dfed637eb55ef84182d3ce0a112bd8b828130 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Sun, 4 Nov 2012 12:13:19 +0200
Subject: [PATCH] solver: fix package prefence calculation a bit

---
 src/solver.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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)
-- 
1.8.0