diff options
author | Michael Schroeder <mls@suse.de> | 2012-11-21 16:21:48 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-11-21 16:21:48 +0100 |
commit | 20ba2e3948781829e25c4c2eade4aaf73c0e1da8 (patch) | |
tree | 0905a383e5fef772641a9653465d43fa13e0efc0 /examples/pysolv | |
parent | 78bc17cb1b658e723e7855c0cc645c68f2971a6e (diff) | |
download | libsolv-20ba2e3948781829e25c4c2eade4aaf73c0e1da8.tar.gz libsolv-20ba2e3948781829e25c4c2eade4aaf73c0e1da8.tar.bz2 libsolv-20ba2e3948781829e25c4c2eade4aaf73c0e1da8.zip |
use "isemptyupdate" method to check for updates with no matching installed package
Diffstat (limited to 'examples/pysolv')
-rwxr-xr-x | examples/pysolv | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/pysolv b/examples/pysolv index 4ad4ca4..41f5cda 100755 --- a/examples/pysolv +++ b/examples/pysolv @@ -730,11 +730,10 @@ if cmd == 'install' or cmd == 'erase' or cmd == 'up' or cmd == 'dup' or cmd == ' sys.exit(1) for job in jobs: if cmd == 'up': + job.how |= Job.SOLVER_UPDATE # up magic: use install instead of update if no installed package matches - if job.how == Job.SOLVER_SOLVABLE_ALL or filter(lambda s: s.isinstalled(), job.solvables()): - job.how |= Job.SOLVER_UPDATE - else: - job.how |= Job.SOLVER_INSTALL + if job.isemptyupdate(): + job.how ^= Job.SOLVER_UPDATE ^ Job.SOLVER_INSTALL elif cmd == 'install': job.how |= Job.SOLVER_INSTALL elif cmd == 'erase': |