summaryrefslogtreecommitdiff
path: root/src/solver.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:57:44 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:57:44 +0900
commita52345de1f81f92a1bd69365def64a91cfd782ff (patch)
tree6aec050bd09098149e190a3c4cadcca31f1242a9 /src/solver.c
parent2b7fc13cedc8bb796ac2b7e88f664d1602cf701f (diff)
downloadlibsolv-a52345de1f81f92a1bd69365def64a91cfd782ff.tar.gz
libsolv-a52345de1f81f92a1bd69365def64a91cfd782ff.tar.bz2
libsolv-a52345de1f81f92a1bd69365def64a91cfd782ff.zip
Imported Upstream version 0.6.20upstream/0.6.20
Change-Id: I10c9c8261b23346d1f65101bdb28d657cb058543 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'src/solver.c')
-rw-r--r--src/solver.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/src/solver.c b/src/solver.c
index 261f367..d5989cc 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -2193,8 +2193,8 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
rr -= solv->installed->end - solv->installed->start;
if (!rr->p) /* identical to update rule? */
rr = r;
- if (!rr->p && !(specialupdaters && specialupdaters[i - installed->start]))
- continue; /* orpaned package */
+ if (!rr->p)
+ continue; /* orpaned package or pseudo package */
/* check if we should update this package to the latest version
* noupdate is set for erase jobs, in that case we want to deinstall
@@ -2203,21 +2203,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
queue_empty(&dq);
if (!MAPTST(&solv->noupdate, i - installed->start) && (solv->decisionmap[i] < 0 || solv->updatemap_all || (solv->updatemap.size && MAPTST(&solv->updatemap, i - installed->start)) || (rr->p && rr->p != i)))
{
- if (!rr->p)
- {
- /* specialupdater with no update/feature rule */
- for (d = specialupdaters[i - installed->start]; (p = pool->whatprovidesdata[d++]) != 0; )
- {
- if (solv->decisionmap[p] > 0)
- {
- dq.count = 0;
- break;
- }
- if (!solv->decisionmap[p])
- queue_push(&dq, p);
- }
- }
- else if (specialupdaters && (d = specialupdaters[i - installed->start]) != 0)
+ if (specialupdaters && (d = specialupdaters[i - installed->start]) != 0)
{
/* special multiversion handling, make sure best version is chosen */
if (rr->p == i && solv->decisionmap[i] >= 0)
@@ -3716,7 +3702,7 @@ solver_solve(Solver *solv, Queue *job)
solver_addrule(solv, 0, 0, 0); /* create dummy rule */
continue;
}
- solver_addupdaterule(solv, s, 1); /* allow s to be updated */
+ solver_addfeaturerule(solv, s);
}
/* make sure we accounted for all rules */
assert(solv->nrules - solv->featurerules == installed->end - installed->start);
@@ -3744,7 +3730,7 @@ solver_solve(Solver *solv, Queue *job)
solver_addrule(solv, 0, 0, 0); /* create dummy rule */
continue;
}
- solver_addupdaterule(solv, s, 0); /* allowall = 0: downgrades not allowed */
+ solver_addupdaterule(solv, s);
/*
* check for and remove duplicate
*/
@@ -3759,9 +3745,10 @@ solver_solve(Solver *solv, Queue *job)
/* it's also orphaned if the feature rule consists just of the installed package */
if (!solv->dupmap_all && sr->p == i && !sr->d && !sr->w2)
queue_push(&solv->orphaned, i);
+
if (!solver_rulecmp(solv, r, sr))
memset(sr, 0, sizeof(*sr)); /* delete unneeded feature rule */
- else
+ else if (sr->p)
solver_disablerule(solv, sr); /* disable feature rule for now */
}
/* consistency check: we added a rule for _every_ installed solvable */
@@ -3990,6 +3977,11 @@ solver_solve(Solver *solv, Queue *job)
else
solv->duprules = solv->duprules_end = solv->nrules;
+#ifdef ENABLE_LINKED_PKGS
+ if (solv->instbuddy && solv->updatemap.size)
+ extend_updatemap_to_buddies(solv);
+#endif
+
if (solv->bestupdatemap_all || solv->bestupdatemap.size || hasbestinstalljob)
solver_addbestrules(solv, hasbestinstalljob);
else
@@ -4485,6 +4477,11 @@ solver_describe_decision(Solver *solv, Id p, Id *infop)
return SOLVER_REASON_CLEANDEPS_ERASE;
return SOLVER_REASON_KEEP_INSTALLED;
}
+ if (i < solv->decisioncnt_weak)
+ {
+ if (why == 0 && pp < 0)
+ return SOLVER_REASON_CLEANDEPS_ERASE;
+ }
if (why > 0)
return SOLVER_REASON_RESOLVE;
/* weak or orphaned */