libsolv/0003-Check-keep_orphans-flag-in-solver_addduprules.patch
Igor Gnatenko 19941199c5 Update to 0.6.14; Backport patches from upstream
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2015-10-12 18:54:15 +02:00

34 lines
1.0 KiB
Diff

From d5af25c0ef8fb01e5b0d377a2d7223281991b960 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 14:03:55 +0200
Subject: [PATCH 3/4] Check keep_orphans flag in solver_addduprules
solver_addduprules is called if allowuninstall is set
---
src/rules.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/rules.c b/src/rules.c
index b941986..ead78d6 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1835,6 +1835,15 @@ solver_addduprules(Solver *solv, Map *addedmap)
if (is->evr == ps->evr && solvable_identical(ps, is))
break;
}
+ if (!ip && solv->dupmap_all && solv->keep_orphans)
+ {
+ /* is this an orphan we should keep? */
+ Rule *r = solv->rules + solv->featurerules + (p - solv->installed->start);
+ if (!r->p)
+ r = solv->rules + solv->updaterules + (p - solv->installed->start);
+ if (r->p == p && !r->d)
+ ip = p;
+ }
if (!ip)
solver_addrule(solv, -p, 0, 0); /* no match, sorry */
else
--
2.6.1