diff options
author | Michael Schroeder <mls@suse.de> | 2012-03-26 13:38:08 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-03-26 13:38:08 +0200 |
commit | d4295440a1b7555d666884728d2939e7a24cc1ec (patch) | |
tree | d1aa0475947416658bab0fef06e160b54fa9b3e3 /src/policy.c | |
parent | 187bef53f00a1b6640d7681a4fa4c1506ab4ac30 (diff) | |
download | libsolv-d4295440a1b7555d666884728d2939e7a24cc1ec.tar.gz libsolv-d4295440a1b7555d666884728d2939e7a24cc1ec.tar.bz2 libsolv-d4295440a1b7555d666884728d2939e7a24cc1ec.zip |
- add "allownamechange" flag for completeness
Diffstat (limited to 'src/policy.c')
-rw-r--r-- | src/policy.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/policy.c b/src/policy.c index 40fe50e..3e8a6ed 100644 --- a/src/policy.c +++ b/src/policy.c @@ -748,6 +748,11 @@ policy_is_illegal(Solver *solv, Solvable *is, Solvable *s, int ignore) if (is->vendor != s->vendor && policy_illegal_vendorchange(solv, is, s)) ret |= POLICY_ILLEGAL_VENDORCHANGE; } + if (!(ignore & POLICY_ILLEGAL_NAMECHANGE) && !(duppkg ? solv->dup_allownamechange : !solv->allownamechange)) + { + if (is->name != s->name) + ret |= POLICY_ILLEGAL_NAMECHANGE; + } return ret; } @@ -854,11 +859,13 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all) Solvable *ps; int haveprovobs = 0; int allowdowngrade = allow_all ? 1 : solv->allowdowngrade; + int allownamechange = allow_all ? 1 : solv->allownamechange; int allowarchchange = allow_all ? 1 : solv->allowarchchange; int allowvendorchange = allow_all ? 1 : solv->allowvendorchange; if (allow_all == 2) { allowdowngrade = solv->dup_allowdowngrade; + allownamechange = solv->dup_allownamechange; allowarchchange = solv->dup_allowarchchange; allowvendorchange = solv->dup_allowvendorchange; } @@ -886,6 +893,8 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all) if (!allowdowngrade && pool_evrcmp(pool, s->evr, ps->evr, EVRCMP_COMPARE) > 0) continue; } + else if (!allownamechange) + continue; else if (!solv->noupdateprovide && ps->obsoletes) /* provides/obsoletes combination ? */ { obsp = ps->repo->idarraydata + ps->obsoletes; @@ -919,6 +928,8 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all) continue; queue_push(qs, p); } + if (!allownamechange) + return; /* if we have found some valid candidates and noupdateprovide is not set, we're done. otherwise we fallback to all obsoletes */ if (!solv->noupdateprovide && haveprovobs) |