- add support for SOLVER_SOLVABLE_REPO, used by SOLVER_DISTUPGRADE
authorMichael Schroeder <mls@suse.de>
Tue, 25 Aug 2009 12:17:09 +0000 (14:17 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 25 Aug 2009 12:17:09 +0000 (14:17 +0200)
- fix vendorcheck in solvable_identical

src/rules.c
src/solvable.c
src/solver.c
src/solver.h
src/solverdebug.c

index 225c4d8..d264647 100644 (file)
@@ -1156,6 +1156,8 @@ solver_createdupmaps(Solver *solv)
       switch (how & SOLVER_JOBMASK)
        {
        case SOLVER_DISTUPGRADE:
+         if ((how & SOLVER_SELECTMASK) != SOLVER_SOLVABLE_REPO)
+           break;
          if (what <= 0 || what > pool->nrepos)
            break;
          repo = pool_id2repo(pool, what);
index 6f6f590..dfe8ce1 100644 (file)
@@ -508,7 +508,8 @@ solvable_identical(Solvable *s1, Solvable *s2)
     return 0;
   if (s1->evr != s2->evr)
     return 0;
-  if (s1->vendor != s2->vendor)
+  /* map missing vendor to empty string */
+  if ((s1->vendor ? s1->vendor : 1) != (s2->vendor ? s2->vendor : 1))
     return 0;
 
   /* looking good, try some fancier stuff */
index 842ad6b..da5493c 100644 (file)
@@ -2796,7 +2796,7 @@ solver_solve(Solver *solv, Queue *job)
            }
          break;
        case SOLVER_DISTUPGRADE:
-         POOL_DEBUG(SAT_DEBUG_JOB, "job: distupgrade repo #%d\n", what);
+         POOL_DEBUG(SAT_DEBUG_JOB, "job: distupgrade %s\n", solver_select2str(solv, select, what));
          break;
        default:
          POOL_DEBUG(SAT_DEBUG_JOB, "job: unknown job\n");
index 5b3884e..b93f9e2 100644 (file)
@@ -216,6 +216,7 @@ typedef struct _Solver {
 #define SOLVER_SOLVABLE_NAME           0x02
 #define SOLVER_SOLVABLE_PROVIDES       0x03
 #define SOLVER_SOLVABLE_ONE_OF         0x04
+#define SOLVER_SOLVABLE_REPO           0x05
 
 #define SOLVER_SELECTMASK              0xff
 
@@ -359,9 +360,11 @@ solver_create_state_maps(Solver *solv, Map *installedmap, Map *conflictsmap)
          l = r->p; l; l = (dp != &r->w2 + 1 ? *dp++ : 0))
 
 /* iterate over all packages selected by a job */
-#define FOR_JOB_SELECT(p, pp, select, what) \
-    for (pp = (select == SOLVER_SOLVABLE ? 0 : \
-               select == SOLVER_SOLVABLE_ONE_OF ? what : \
+#define FOR_JOB_SELECT(p, pp, select, what)                    \
+    if (select == SOLVER_SOLVABLE_REPO)                                \
+       p = pp = 0;                                             \
+    else for (pp = (select == SOLVER_SOLVABLE ? 0 :            \
+               select == SOLVER_SOLVABLE_ONE_OF ? what :       \
                pool_whatprovides(pool, what)),                         \
          p = (select == SOLVER_SOLVABLE ? what : pool->whatprovidesdata[pp++]) ; p ; p = pool->whatprovidesdata[pp++]) \
       if (select != SOLVER_SOLVABLE_NAME || pool_match_nevr(pool, pool->solvables + p, what))
index 48cfaba..1f1f9c6 100644 (file)
@@ -795,5 +795,11 @@ solver_select2str(Solver *solv, Id select, Id what)
        }
       return *b ? b + 2 : "nothing";
     }
+  if (select == SOLVER_SOLVABLE_REPO)
+    {
+      b = pool_alloctmpspace(pool, 20);
+      sprintf(b, "repo #%d", what);
+      return b;
+    }
   return "unknown job select";
 }