]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
- 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 225c4d8abbc503d3af00e776689b995d83aa6546..d264647fa86101d27c2311e9495514614d34a567 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 6f6f5908ac6db6375ed2db6a81c3e239a298c8b5..dfe8ce12542a00944bdc3d783287a80e60e53324 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 842ad6beff5c4ab103eae685eef462236f6c8bd8..da5493c5b281e8c597b8c0128f1fcfc2763551da 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 5b3884e78f054278727483730d5a79ea3866ec8c..b93f9e261f78b37443b9b66763d998083e62aed2 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 48cfabafa122c7b2f3eec267b94ce439f10e2401..1f1f9c65b167d12b85b2e68e7851564cb8ec1029 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";
 }