ref: refs/heads/master
commit b759e2dbc8c4f3e780abed199b38c93ee33c5297
Author: Michael Schroeder
Date: Thu Jul 16 14:14:47 2009 +0200
- switch mode to install when not package is not installed
---
examples/solv.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/examples/solv.c b/examples/solv.c
index e86d3ee..a64d9a0 100644
--- a/examples/solv.c
+++ b/examples/solv.c
@@ -1800,7 +1800,20 @@ main(int argc, char **argv)
// add mode
for (i = 0; i < job.count; i += 2)
- job.elements[i] |= mode;
+ {
+ if (mode == SOLVER_UPDATE)
+ {
+ FOR_JOB_SELECT(p, pp, job.elements[i], job.elements[i + 1])
+ if (pool->installed && pool->solvables[p].repo == pool->installed)
+ break;
+ if (!p)
+ {
+ job.elements[i] |= SOLVER_INSTALL;
+ continue;
+ }
+ }
+ job.elements[i] |= mode;
+ }
// multiversion test
// queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, str2id(pool, "kernel-pae", 1));
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org