summaryrefslogtreecommitdiff
path: root/examples/pysolv
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-02-04 17:41:31 +0100
committerMichael Schroeder <mls@suse.de>2013-02-04 17:41:31 +0100
commit460454535325e5b00c78f9f30afa3bc67e3f6038 (patch)
tree211fbf9b5bb6b3a2a4e17ede8784edfdea5a7291 /examples/pysolv
parent2bd102f701f4f018a2971c9e058538280785f24d (diff)
downloadlibsolv-460454535325e5b00c78f9f30afa3bc67e3f6038.tar.gz
libsolv-460454535325e5b00c78f9f30afa3bc67e3f6038.tar.bz2
libsolv-460454535325e5b00c78f9f30afa3bc67e3f6038.zip
reuse solver in examples
Diffstat (limited to 'examples/pysolv')
-rwxr-xr-xexamples/pysolv12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/pysolv b/examples/pysolv
index d7fc9bd..18327d7 100755
--- a/examples/pysolv
+++ b/examples/pysolv
@@ -689,7 +689,7 @@ for arg in args:
jobs.append(pool.Job(Job.SOLVER_SOLVABLE, cmdlinerepo['packages'][arg]))
else:
flags = Selection.SELECTION_NAME|Selection.SELECTION_PROVIDES|Selection.SELECTION_GLOB
- flags |= Selection.SELECTION_CANON|Selection.SELECTION_DOTARCH|Selection.SELECTION_REL
+ flags |= Selection.SELECTION_CANON|Selection.SELECTION_DOTARCH|Selection.SELECTION_REL
if len(arg) and arg[0] == '/':
flags |= Selection.SELECTION_FILELIST
if cmd == 'erase':
@@ -752,12 +752,12 @@ for job in jobs:
job.how |= Job.SOLVER_CLEANDEPS
#pool.set_debuglevel(2)
-solver = None
+solver = pool.Solver()
+solver.set_flag(Solver.SOLVER_FLAG_SPLITPROVIDES, 1);
+if cmd == 'erase':
+ solver.set_flag(Solver.SOLVER_FLAG_ALLOW_UNINSTALL, 1);
+
while True:
- solver = pool.Solver()
- solver.set_flag(Solver.SOLVER_FLAG_SPLITPROVIDES, 1);
- if cmd == 'erase':
- solver.set_flag(Solver.SOLVER_FLAG_ALLOW_UNINSTALL, 1);
problems = solver.solve(jobs)
if not problems:
break