From daf8c09713e05d05295cf25b10e4ae35c7731522 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Mon, 25 Jun 2012 11:27:57 +0200 Subject: [PATCH] - add SOLVER_ORUPDATE and SOLVER_FORCEBEST (see solver.h) --- ext/testcase.c | 2 ++ src/solver.c | 3 ++- src/solver.h | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ext/testcase.c b/ext/testcase.c index 9d161fe..d834654 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -53,6 +53,8 @@ static struct jobflags2str { { SOLVER_WEAK, "weak" }, { SOLVER_ESSENTIAL, "essential" }, { SOLVER_CLEANDEPS, "cleandeps" }, + { SOLVER_ORUPDATE, "orupdate" }, + { SOLVER_FORCEBEST, "forcebest" }, { SOLVER_SETEV, "setev" }, { SOLVER_SETEVR, "setevr" }, { SOLVER_SETARCH, "setarch" }, diff --git a/src/solver.c b/src/solver.c index ef116c2..68ff49f 100644 --- a/src/solver.c +++ b/src/solver.c @@ -1681,7 +1681,8 @@ solver_run_sat(Solver *solv, int disablerules, int doweak) if (l || !dq.count) continue; /* prune to installed if not updating */ - if (dq.count > 1 && solv->installed && !solv->updatemap_all) + if (dq.count > 1 && solv->installed && !solv->updatemap_all && + !(solv->job.elements[solv->ruletojob.elements[i - solv->jobrules]] & SOLVER_ORUPDATE)) { int j, k; for (j = k = 0; j < dq.count; j++) diff --git a/src/solver.h b/src/solver.h index 9207557..46be845 100644 --- a/src/solver.h +++ b/src/solver.h @@ -249,6 +249,15 @@ typedef struct _Solver Solver; #define SOLVER_WEAK 0x010000 #define SOLVER_ESSENTIAL 0x020000 #define SOLVER_CLEANDEPS 0x040000 +/* ORUPDATE makes SOLVER_INSTALL not prune to installed + * packages, thus updating installed packages */ +#define SOLVER_ORUPDATE 0x080000 +/* FORCEBEST makes the solver insist on best packages, so + * you will get problem reported if the best package is + * not installable. This can be used with INSTALL, UPDATE + * and DISTUPGRADE */ +/* Also, it's not implemented yet ;) */ +#define SOLVER_FORCEBEST 0x100000 #define SOLVER_SETEV 0x01000000 #define SOLVER_SETEVR 0x02000000 -- 2.7.4