- rename SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED to SOLVER_FLAG_ADD_ALREADY_RECOMMENDE...
authorMichael Schroeder <mls@suse.de>
Fri, 24 Feb 2012 10:50:05 +0000 (11:50 +0100)
committerMichael Schroeder <mls@suse.de>
Fri, 24 Feb 2012 10:50:05 +0000 (11:50 +0100)
Our policy is that the default should be zero and cover the most uses. Last chance
to do the change. (sorry libzypp and hawkeye folks.)

bindings/solv.i
examples/p5solv
examples/pysolv
examples/rbsolv
examples/solv.c
ext/testcase.c
src/solver.c
src/solver.h

index 1b080de..b34eb23 100644 (file)
@@ -2137,7 +2137,7 @@ typedef struct {
   static const int SOLVER_FLAG_NO_UPDATEPROVIDE = SOLVER_FLAG_NO_UPDATEPROVIDE;
   static const int SOLVER_FLAG_SPLITPROVIDES = SOLVER_FLAG_SPLITPROVIDES;
   static const int SOLVER_FLAG_IGNORE_RECOMMENDED = SOLVER_FLAG_IGNORE_RECOMMENDED;
-  static const int SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED = SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED;
+  static const int SOLVER_FLAG_ADD_ALREADY_RECOMMENDED = SOLVER_FLAG_ADD_ALREADY_RECOMMENDED;
   static const int SOLVER_FLAG_NO_INFARCHCHECK = SOLVER_FLAG_NO_INFARCHCHECK;
 
   ~Solver() {
index f864997..015002e 100755 (executable)
@@ -754,7 +754,6 @@ if ($cmd eq 'install' || $cmd eq 'erase' || $cmd eq 'up' || $cmd eq 'dup' || $cm
   my $solver;
   while (1) {
     $solver = $pool->Solver();
-    $solver->set_flag($solv::Solver::SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1);
     $solver->set_flag($solv::Solver::SOLVER_FLAG_SPLITPROVIDES, 1);
     $solver->set_flag($solv::Solver::SOLVER_FLAG_ALLOW_UNINSTALL, 1) if $cmd eq 'erase';
     my @problems = $solver->solve(\@jobs);
index 8dea8ea..fa723a0 100755 (executable)
@@ -848,7 +848,6 @@ if cmd == 'install' or cmd == 'erase' or cmd == 'up' or cmd == 'dup' or cmd == '
     solver = None
     while True:
         solver = pool.Solver()
-        solver.set_flag(Solver.SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1);
         solver.set_flag(Solver.SOLVER_FLAG_SPLITPROVIDES, 1);
         if cmd == 'erase':
             solver.set_flag(Solver.SOLVER_FLAG_ALLOW_UNINSTALL, 1);
index 52853cf..90be909 100755 (executable)
@@ -756,7 +756,6 @@ if cmd == 'install' || cmd == 'erase' || cmd == 'up' || cmd == 'dup' || cmd == '
   #pool.set_debuglevel(1)
   while true
     solver = pool.Solver
-    solver.set_flag(Solv::Solver::SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1)
     solver.set_flag(Solv::Solver::SOLVER_FLAG_SPLITPROVIDES, 1)
     solver.set_flag(Solv::Solver::SOLVER_FLAG_ALLOW_UNINSTALL, 1) if cmd == 'erase'
     problems = solver.solve(jobs)
index 7d69028..df43a80 100644 (file)
@@ -3020,7 +3020,6 @@ rerunsolver:
       int pcnt, scnt;
 
       solv = solver_create(pool);
-      solver_set_flag(solv, SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1);
       solver_set_flag(solv, SOLVER_FLAG_SPLITPROVIDES, 1);
       if (mainmode == MODE_ERASE)
         solver_set_flag(solv, SOLVER_FLAG_ALLOW_UNINSTALL, 1); /* don't nag */
index cf7a82c..fda56f1 100644 (file)
@@ -90,7 +90,7 @@ static struct solverflags2str {
   { SOLVER_FLAG_NO_UPDATEPROVIDE,           "noupdateprovide", 0 },
   { SOLVER_FLAG_SPLITPROVIDES,              "splitprovides", 0 },
   { SOLVER_FLAG_IGNORE_RECOMMENDED,         "ignorerecommended", 0 },
-  { SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, "ignorealreadyrecommended", 0 },
+  { SOLVER_FLAG_ADD_ALREADY_RECOMMENDED,    "addalreadyrecommended", 0 },
   { SOLVER_FLAG_NO_INFARCHCHECK,            "noinfarchcheck", 0 },
   { 0, 0, 0 }
 };
index 3551f58..667190a 100644 (file)
@@ -1385,8 +1385,8 @@ solver_get_flag(Solver *solv, int flag)
     return solv->dosplitprovides;
   case SOLVER_FLAG_IGNORE_RECOMMENDED:
     return solv->dontinstallrecommended;
-  case SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED:
-    return solv->ignorealreadyrecommended;
+  case SOLVER_FLAG_ADD_ALREADY_RECOMMENDED:
+    return solv->addalreadyrecommended;
   case SOLVER_FLAG_NO_INFARCHCHECK:
     return solv->noinfarchcheck;
   default:
@@ -1422,8 +1422,8 @@ solver_set_flag(Solver *solv, int flag, int value)
   case SOLVER_FLAG_IGNORE_RECOMMENDED:
     solv->dontinstallrecommended = value;
     break;
-  case SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED:
-    solv->ignorealreadyrecommended = value;
+  case SOLVER_FLAG_ADD_ALREADY_RECOMMENDED:
+    solv->addalreadyrecommended = value;
     break;
   case SOLVER_FLAG_NO_INFARCHCHECK:
     solv->noinfarchcheck = value;
@@ -1884,7 +1884,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
                  /* installed, check for recommends */
                  Id *recp, rec, pp, p;
                  s = pool->solvables + i;
-                 if (solv->ignorealreadyrecommended && s->repo == solv->installed)
+                 if (!solv->addalreadyrecommended && s->repo == solv->installed)
                    continue;
                  /* XXX need to special case AND ? */
                  if (s->recommends)
@@ -1960,7 +1960,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
            }
 
           /* filter out all already supplemented packages if requested */
-          if (solv->ignorealreadyrecommended && dqs.count)
+          if (!solv->addalreadyrecommended && dqs.count)
            {
              /* turn off all new packages */
              for (i = 0; i < solv->decisionq.count; i++)
@@ -2082,7 +2082,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
                  if (p < 0)
                    continue;
                  s = pool->solvables + p;
-                 if (!s->repo || (solv->ignorealreadyrecommended && s->repo == solv->installed))
+                 if (!s->repo || (!solv->addalreadyrecommended && s->repo == solv->installed))
                    continue;
                  if (!s->recommends)
                    continue;
@@ -2484,7 +2484,7 @@ solver_solve(Solver *solv, Queue *job)
   POOL_DEBUG(SOLV_DEBUG_STATS, "allowuninstall=%d, allowdowngrade=%d, allowarchchange=%d, allowvendorchange=%d\n", solv->allowuninstall, solv->allowdowngrade, solv->allowarchchange, solv->allowvendorchange);
   POOL_DEBUG(SOLV_DEBUG_STATS, "promoteepoch=%d, forbidselfconflicts=%d\n", pool->promoteepoch, pool->forbidselfconflicts);
   POOL_DEBUG(SOLV_DEBUG_STATS, "obsoleteusesprovides=%d, implicitobsoleteusesprovides=%d, obsoleteusescolors=%d\n", pool->obsoleteusesprovides, pool->implicitobsoleteusesprovides, pool->obsoleteusescolors);
-  POOL_DEBUG(SOLV_DEBUG_STATS, "dontinstallrecommended=%d, ignorealreadyrecommended=%d\n", solv->dontinstallrecommended, solv->ignorealreadyrecommended);
+  POOL_DEBUG(SOLV_DEBUG_STATS, "dontinstallrecommended=%d, addalreadyrecommended=%d\n", solv->dontinstallrecommended, solv->addalreadyrecommended);
 
   /* create whatprovides if not already there */
   if (!pool->whatprovides)
@@ -3445,7 +3445,7 @@ solver_describe_weakdep_decision(Solver *solv, Id p, Queue *whyq)
       s = pool->solvables + i;
       if (!s->recommends)
        continue;
-      if (solv->ignorealreadyrecommended && s->repo == solv->installed)
+      if (!solv->addalreadyrecommended && s->repo == solv->installed)
        continue;
       recp = s->repo->idarraydata + s->recommends;
       while ((rec = *recp++) != 0)
@@ -3490,7 +3490,7 @@ solver_describe_weakdep_decision(Solver *solv, Id p, Queue *whyq)
            /* let's see if this is an easy supp */
            FOR_PROVIDES(p2, pp2, sup)
              {
-               if (solv->ignorealreadyrecommended && solv->installed)
+               if (!solv->addalreadyrecommended && solv->installed)
                  {
                    if (pool->solvables[p2].repo == solv->installed)
                      continue;
index e7d24b2..7787c49 100644 (file)
@@ -189,7 +189,7 @@ struct _Solver {
   int noupdateprovide;                 /* true: update packages needs not to provide old package */
   int dosplitprovides;                 /* true: consider legacy split provides */
   int dontinstallrecommended;          /* true: do not install recommended packages */
-  int ignorealreadyrecommended;                /* true: ignore recommended packages that were already recommended by the installed packages */
+  int addalreadyrecommended;           /* true: also install recommended packages that were already recommended by the installed packages */
   int dontshowinstalledrecommended;    /* true: do not show recommended packages that are already installed */
   
   int noinfarchcheck;                  /* true: do not forbid inferior architectures */
@@ -277,7 +277,7 @@ typedef struct _Solver Solver;
 #define SOLVER_FLAG_NO_UPDATEPROVIDE           5
 #define SOLVER_FLAG_SPLITPROVIDES              6
 #define SOLVER_FLAG_IGNORE_RECOMMENDED         7
-#define SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED 8
+#define SOLVER_FLAG_ADD_ALREADY_RECOMMENDED    8
 #define SOLVER_FLAG_NO_INFARCHCHECK            9
 
 extern Solver *solver_create(Pool *pool);