diff options
author | Michael Schroeder <mls@suse.de> | 2012-11-19 17:32:07 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-11-19 17:32:07 +0100 |
commit | 5a7ca4eb2349deafecbe366f15c043cb50a08ac7 (patch) | |
tree | df1e4e1edeec21c9022b84d92800c75ce8fdbf9c /examples/solv.c | |
parent | 3c0edb72aaff99dfc2dd932e69f61f6e19c72dc5 (diff) | |
download | libsolv-5a7ca4eb2349deafecbe366f15c043cb50a08ac7.tar.gz libsolv-5a7ca4eb2349deafecbe366f15c043cb50a08ac7.tar.bz2 libsolv-5a7ca4eb2349deafecbe366f15c043cb50a08ac7.zip |
implement '--best' in solv demo
Diffstat (limited to 'examples/solv.c')
-rw-r--r-- | examples/solv.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/solv.c b/examples/solv.c index beb5bd3..d1857fa 100644 --- a/examples/solv.c +++ b/examples/solv.c @@ -2426,6 +2426,7 @@ main(int argc, char **argv) Queue addedfileprovides_inst; Queue repofilter; int cleandeps = 0; + int forcebest = 0; char *rootdir = 0; argc--; @@ -2500,6 +2501,12 @@ main(int argc, char **argv) argc--; argv++; } + else if (argc > 1 && !strcmp(argv[1], "--best")) + { + forcebest = 1; + argc--; + argv++; + } else break; } @@ -2782,6 +2789,8 @@ main(int argc, char **argv) job.elements[i] ^= SOLVER_UPDATE ^ SOLVER_INSTALL; if (cleandeps) job.elements[i] |= SOLVER_CLEANDEPS; + if (forcebest) + job.elements[i] |= SOLVER_FORCEBEST; } // multiversion test @@ -2805,6 +2814,7 @@ rerunsolver: solver_set_flag(solv, SOLVER_FLAG_SPLITPROVIDES, 1); if (mainmode == MODE_ERASE) solver_set_flag(solv, SOLVER_FLAG_ALLOW_UNINSTALL, 1); /* don't nag */ + solver_set_flag(solv, SOLVER_FLAG_BEST_OBEY_POLICY, 1); if (!solver_solve(solv, &job)) break; |