aboutsummaryrefslogtreecommitdiffstats
path: root/main/apk-tools/0001-solver-fix-cleaning-of-packages-that-got-replaced-by.patch
blob: 6f3ca6626085b4d572aeb718d66617e25206519f (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 9fa64ca1db84c7a57434498651218d02da57ca04 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Thu, 10 Apr 2014 09:52:40 +0300
Subject: [PATCH] solver: fix cleaning of packages that got replaced by
 provides

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

diff --git a/src/solver.c b/src/solver.c
index 31b3db7..9c513c7 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -786,10 +786,13 @@ static void cset_gen_name_remove(struct apk_solver_state *ss, struct apk_package
 {
 	struct apk_name *name = pkg->name, **pname;
 
-	if (name->ss.chosen.pkg != NULL || name->ss.in_changeset)
+	if (pkg->ss.in_changeset ||
+	    (name->ss.chosen.pkg != NULL &&
+	     name->ss.chosen.pkg->name == name))
 		return;
 
 	name->ss.in_changeset = 1;
+	pkg->ss.in_changeset = 1;
 	foreach_array_item(pname, pkg->name->rinstall_if)
 		cset_check_removal_by_iif(ss, *pname);
 	record_change(ss, pkg, NULL);
-- 
1.9.1