- add SOLVER_ORUPDATE and SOLVER_FORCEBEST (see solver.h)
authorMichael Schroeder <mls@suse.de>
Mon, 25 Jun 2012 09:27:57 +0000 (11:27 +0200)
committerMichael Schroeder <mls@suse.de>
Mon, 25 Jun 2012 09:27:57 +0000 (11:27 +0200)
ext/testcase.c
src/solver.c
src/solver.h

index 9d161fe..d834654 100644 (file)
@@ -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" },
index ef116c2..68ff49f 100644 (file)
@@ -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++)
index 9207557..46be845 100644 (file)
@@ -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