SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES
authorZdeněk Pavlas <zpavlas@redhat.com>
Tue, 10 Apr 2012 13:21:40 +0000 (15:21 +0200)
committerZdeněk Pavlas <zpavlas@redhat.com>
Tue, 10 Apr 2012 13:50:49 +0000 (15:50 +0200)
true: process explicit obsoletes in multiinstall.
Defaults to 0.  Needed for compatibility with 'yum'.

src/rules.c
src/solver.c
src/solver.h

index 00d5c33..bf98b18 100644 (file)
@@ -665,7 +665,7 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
        {
          int noobs = solv->noobsoletes.size && MAPTST(&solv->noobsoletes, n);
          int isinstalled = (installed && s->repo == installed);
-         if (s->obsoletes && !noobs)
+         if (s->obsoletes && (!noobs || solv->keepexplicitobsoletes))
            {
              obsp = s->repo->idarraydata + s->obsoletes;
              /* foreach obsoletes */
index f19d7da..ef116c2 100644 (file)
@@ -1473,6 +1473,8 @@ solver_get_flag(Solver *solv, int flag)
     return solv->addalreadyrecommended;
   case SOLVER_FLAG_NO_INFARCHCHECK:
     return solv->noinfarchcheck;
+  case SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES:
+    return solv->keepexplicitobsoletes;
   default:
     break;
   }
@@ -1515,6 +1517,9 @@ solver_set_flag(Solver *solv, int flag, int value)
   case SOLVER_FLAG_NO_INFARCHCHECK:
     solv->noinfarchcheck = value;
     break;
+  case SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES:
+    solv->keepexplicitobsoletes = value;
+    break;
   default:
     break;
   }
index 84ffb8e..ddab97b 100644 (file)
@@ -194,6 +194,7 @@ struct _Solver {
   int dontshowinstalledrecommended;    /* true: do not show recommended packages that are already installed */
   
   int noinfarchcheck;                  /* true: do not forbid inferior architectures */
+  int keepexplicitobsoletes;           /* true: honor obsoletes during multiinstall */
 
     
   Map dupmap;                          /* dup these packages*/
@@ -283,6 +284,7 @@ typedef struct _Solver Solver;
 #define SOLVER_FLAG_ADD_ALREADY_RECOMMENDED    8
 #define SOLVER_FLAG_NO_INFARCHCHECK            9
 #define SOLVER_FLAG_ALLOW_NAMECHANGE           10
+#define SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES    11
 
 extern Solver *solver_create(Pool *pool);
 extern void solver_free(Solver *solv);