summaryrefslogtreecommitdiff
path: root/examples/pysolv
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-11-21 16:21:48 +0100
committerMichael Schroeder <mls@suse.de>2012-11-21 16:21:48 +0100
commit20ba2e3948781829e25c4c2eade4aaf73c0e1da8 (patch)
tree0905a383e5fef772641a9653465d43fa13e0efc0 /examples/pysolv
parent78bc17cb1b658e723e7855c0cc645c68f2971a6e (diff)
downloadlibsolv-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-xexamples/pysolv7
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':