summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-02-24 11:50:05 +0100
committerMichael Schroeder <mls@suse.de>2012-02-24 11:50:05 +0100
commit296dde1ce1c77508152de9622a82ad9198886142 (patch)
tree835a039863e2a68599d4ed105f13475f3f5e665b
parent530db1f4afc1fec55fa8b3c498c6b99d1df2a537 (diff)
downloadlibsolv-296dde1ce1c77508152de9622a82ad9198886142.tar.gz
libsolv-296dde1ce1c77508152de9622a82ad9198886142.tar.bz2
libsolv-296dde1ce1c77508152de9622a82ad9198886142.zip
- rename SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED to SOLVER_FLAG_ADD_ALREADY_RECOMMENDED and invert.
Our policy is that the default should be zero and cover the most uses. Last chance to do the change. (sorry libzypp and hawkeye folks.)
-rw-r--r--bindings/solv.i2
-rwxr-xr-xexamples/p5solv1
-rwxr-xr-xexamples/pysolv1
-rwxr-xr-xexamples/rbsolv1
-rw-r--r--examples/solv.c1
-rw-r--r--ext/testcase.c2
-rw-r--r--src/solver.c20
-rw-r--r--src/solver.h4
8 files changed, 14 insertions, 18 deletions
diff --git a/bindings/solv.i b/bindings/solv.i
index 1b080de..b34eb23 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -2137,7 +2137,7 @@ typedef struct {
static const int SOLVER_FLAG_NO_UPDATEPROVIDE = SOLVER_FLAG_NO_UPDATEPROVIDE;
static const int SOLVER_FLAG_SPLITPROVIDES = SOLVER_FLAG_SPLITPROVIDES;
static const int SOLVER_FLAG_IGNORE_RECOMMENDED = SOLVER_FLAG_IGNORE_RECOMMENDED;
- static const int SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED = SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED;
+ static const int SOLVER_FLAG_ADD_ALREADY_RECOMMENDED = SOLVER_FLAG_ADD_ALREADY_RECOMMENDED;
static const int SOLVER_FLAG_NO_INFARCHCHECK = SOLVER_FLAG_NO_INFARCHCHECK;
~Solver() {
diff --git a/examples/p5solv b/examples/p5solv
index f864997..015002e 100755
--- a/examples/p5solv
+++ b/examples/p5solv
@@ -754,7 +754,6 @@ if ($cmd eq 'install' || $cmd eq 'erase' || $cmd eq 'up' || $cmd eq 'dup' || $cm
my $solver;
while (1) {
$solver = $pool->Solver();
- $solver->set_flag($solv::Solver::SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1);
$solver->set_flag($solv::Solver::SOLVER_FLAG_SPLITPROVIDES, 1);
$solver->set_flag($solv::Solver::SOLVER_FLAG_ALLOW_UNINSTALL, 1) if $cmd eq 'erase';
my @problems = $solver->solve(\@jobs);
diff --git a/examples/pysolv b/examples/pysolv
index 8dea8ea..fa723a0 100755
--- a/examples/pysolv
+++ b/examples/pysolv
@@ -848,7 +848,6 @@ if cmd == 'install' or cmd == 'erase' or cmd == 'up' or cmd == 'dup' or cmd == '
solver = None
while True:
solver = pool.Solver()
- solver.set_flag(Solver.SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1);
solver.set_flag(Solver.SOLVER_FLAG_SPLITPROVIDES, 1);
if cmd == 'erase':
solver.set_flag(Solver.SOLVER_FLAG_ALLOW_UNINSTALL, 1);
diff --git a/examples/rbsolv b/examples/rbsolv
index 52853cf..90be909 100755
--- a/examples/rbsolv
+++ b/examples/rbsolv
@@ -756,7 +756,6 @@ if cmd == 'install' || cmd == 'erase' || cmd == 'up' || cmd == 'dup' || cmd == '
#pool.set_debuglevel(1)
while true
solver = pool.Solver
- solver.set_flag(Solv::Solver::SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1)
solver.set_flag(Solv::Solver::SOLVER_FLAG_SPLITPROVIDES, 1)
solver.set_flag(Solv::Solver::SOLVER_FLAG_ALLOW_UNINSTALL, 1) if cmd == 'erase'
problems = solver.solve(jobs)
diff --git a/examples/solv.c b/examples/solv.c
index 7d69028..df43a80 100644
--- a/examples/solv.c
+++ b/examples/solv.c
@@ -3020,7 +3020,6 @@ rerunsolver:
int pcnt, scnt;
solv = solver_create(pool);
- solver_set_flag(solv, SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1);
solver_set_flag(solv, SOLVER_FLAG_SPLITPROVIDES, 1);
if (mainmode == MODE_ERASE)
solver_set_flag(solv, SOLVER_FLAG_ALLOW_UNINSTALL, 1); /* don't nag */
diff --git a/ext/testcase.c b/ext/testcase.c
index cf7a82c..fda56f1 100644
--- a/ext/testcase.c
+++ b/ext/testcase.c
@@ -90,7 +90,7 @@ static struct solverflags2str {
{ SOLVER_FLAG_NO_UPDATEPROVIDE, "noupdateprovide", 0 },
{ SOLVER_FLAG_SPLITPROVIDES, "splitprovides", 0 },
{ SOLVER_FLAG_IGNORE_RECOMMENDED, "ignorerecommended", 0 },
- { SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, "ignorealreadyrecommended", 0 },
+ { SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, "addalreadyrecommended", 0 },
{ SOLVER_FLAG_NO_INFARCHCHECK, "noinfarchcheck", 0 },
{ 0, 0, 0 }
};
diff --git a/src/solver.c b/src/solver.c
index 3551f58..667190a 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -1385,8 +1385,8 @@ solver_get_flag(Solver *solv, int flag)
return solv->dosplitprovides;
case SOLVER_FLAG_IGNORE_RECOMMENDED:
return solv->dontinstallrecommended;
- case SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED:
- return solv->ignorealreadyrecommended;
+ case SOLVER_FLAG_ADD_ALREADY_RECOMMENDED:
+ return solv->addalreadyrecommended;
case SOLVER_FLAG_NO_INFARCHCHECK:
return solv->noinfarchcheck;
default:
@@ -1422,8 +1422,8 @@ solver_set_flag(Solver *solv, int flag, int value)
case SOLVER_FLAG_IGNORE_RECOMMENDED:
solv->dontinstallrecommended = value;
break;
- case SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED:
- solv->ignorealreadyrecommended = value;
+ case SOLVER_FLAG_ADD_ALREADY_RECOMMENDED:
+ solv->addalreadyrecommended = value;
break;
case SOLVER_FLAG_NO_INFARCHCHECK:
solv->noinfarchcheck = value;
@@ -1884,7 +1884,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
/* installed, check for recommends */
Id *recp, rec, pp, p;
s = pool->solvables + i;
- if (solv->ignorealreadyrecommended && s->repo == solv->installed)
+ if (!solv->addalreadyrecommended && s->repo == solv->installed)
continue;
/* XXX need to special case AND ? */
if (s->recommends)
@@ -1960,7 +1960,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
}
/* filter out all already supplemented packages if requested */
- if (solv->ignorealreadyrecommended && dqs.count)
+ if (!solv->addalreadyrecommended && dqs.count)
{
/* turn off all new packages */
for (i = 0; i < solv->decisionq.count; i++)
@@ -2082,7 +2082,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
if (p < 0)
continue;
s = pool->solvables + p;
- if (!s->repo || (solv->ignorealreadyrecommended && s->repo == solv->installed))
+ if (!s->repo || (!solv->addalreadyrecommended && s->repo == solv->installed))
continue;
if (!s->recommends)
continue;
@@ -2484,7 +2484,7 @@ solver_solve(Solver *solv, Queue *job)
POOL_DEBUG(SOLV_DEBUG_STATS, "allowuninstall=%d, allowdowngrade=%d, allowarchchange=%d, allowvendorchange=%d\n", solv->allowuninstall, solv->allowdowngrade, solv->allowarchchange, solv->allowvendorchange);
POOL_DEBUG(SOLV_DEBUG_STATS, "promoteepoch=%d, forbidselfconflicts=%d\n", pool->promoteepoch, pool->forbidselfconflicts);
POOL_DEBUG(SOLV_DEBUG_STATS, "obsoleteusesprovides=%d, implicitobsoleteusesprovides=%d, obsoleteusescolors=%d\n", pool->obsoleteusesprovides, pool->implicitobsoleteusesprovides, pool->obsoleteusescolors);
- POOL_DEBUG(SOLV_DEBUG_STATS, "dontinstallrecommended=%d, ignorealreadyrecommended=%d\n", solv->dontinstallrecommended, solv->ignorealreadyrecommended);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "dontinstallrecommended=%d, addalreadyrecommended=%d\n", solv->dontinstallrecommended, solv->addalreadyrecommended);
/* create whatprovides if not already there */
if (!pool->whatprovides)
@@ -3445,7 +3445,7 @@ solver_describe_weakdep_decision(Solver *solv, Id p, Queue *whyq)
s = pool->solvables + i;
if (!s->recommends)
continue;
- if (solv->ignorealreadyrecommended && s->repo == solv->installed)
+ if (!solv->addalreadyrecommended && s->repo == solv->installed)
continue;
recp = s->repo->idarraydata + s->recommends;
while ((rec = *recp++) != 0)
@@ -3490,7 +3490,7 @@ solver_describe_weakdep_decision(Solver *solv, Id p, Queue *whyq)
/* let's see if this is an easy supp */
FOR_PROVIDES(p2, pp2, sup)
{
- if (solv->ignorealreadyrecommended && solv->installed)
+ if (!solv->addalreadyrecommended && solv->installed)
{
if (pool->solvables[p2].repo == solv->installed)
continue;
diff --git a/src/solver.h b/src/solver.h
index e7d24b2..7787c49 100644
--- a/src/solver.h
+++ b/src/solver.h
@@ -189,7 +189,7 @@ struct _Solver {
int noupdateprovide; /* true: update packages needs not to provide old package */
int dosplitprovides; /* true: consider legacy split provides */
int dontinstallrecommended; /* true: do not install recommended packages */
- int ignorealreadyrecommended; /* true: ignore recommended packages that were already recommended by the installed packages */
+ int addalreadyrecommended; /* true: also install recommended packages that were already recommended by the installed packages */
int dontshowinstalledrecommended; /* true: do not show recommended packages that are already installed */
int noinfarchcheck; /* true: do not forbid inferior architectures */
@@ -277,7 +277,7 @@ typedef struct _Solver Solver;
#define SOLVER_FLAG_NO_UPDATEPROVIDE 5
#define SOLVER_FLAG_SPLITPROVIDES 6
#define SOLVER_FLAG_IGNORE_RECOMMENDED 7
-#define SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED 8
+#define SOLVER_FLAG_ADD_ALREADY_RECOMMENDED 8
#define SOLVER_FLAG_NO_INFARCHCHECK 9
extern Solver *solver_create(Pool *pool);