Mailinglist Archive: zypp-commit (38 mails)

< Previous Next >
[zypp-commit] <sat-solver> master : - add support for SOLVER_SOLVABLE_REPO, used by SOLVER_DISTUPGRADE
  • From: Michael Schroeder <mls@xxxxxxx>
  • Date: Tue, 25 Aug 2009 14:17:09 +0200
  • Message-id: <E1MfuyO-0005EA-F1@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 989e22234b532b60d4dea3a740ca022d039bbf64
Author: Michael Schroeder <mls@xxxxxxx>
Date: Tue Aug 25 14:17:09 2009 +0200

- add support for SOLVER_SOLVABLE_REPO, used by SOLVER_DISTUPGRADE
- fix vendorcheck in solvable_identical
---
src/rules.c | 2 ++
src/solvable.c | 3 ++-
src/solver.c | 2 +-
src/solver.h | 9 ++++++---
src/solverdebug.c | 6 ++++++
5 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/rules.c b/src/rules.c
index 225c4d8..d264647 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -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);
diff --git a/src/solvable.c b/src/solvable.c
index 6f6f590..dfe8ce1 100644
--- a/src/solvable.c
+++ b/src/solvable.c
@@ -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 */
diff --git a/src/solver.c b/src/solver.c
index 842ad6b..da5493c 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -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");
diff --git a/src/solver.h b/src/solver.h
index 5b3884e..b93f9e2 100644
--- a/src/solver.h
+++ b/src/solver.h
@@ -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))
diff --git a/src/solverdebug.c b/src/solverdebug.c
index 48cfaba..1f1f9c6 100644
--- a/src/solverdebug.c
+++ b/src/solverdebug.c
@@ -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";
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages