Mailinglist Archive: zypp-commit (38 mails)

< Previous Next >
[zypp-commit] <sat-solver> SuSE-Code-11-Branch : - map missing vendor to empty string
  • From: Michael Schroeder <mls@xxxxxxx>
  • Date: Mon, 17 Aug 2009 15:20:08 +0200
  • Message-id: <E1Md29d-0000eG-4D@xxxxxxxxxxxxxxxx>
ref: refs/heads/SuSE-Code-11-Branch
commit df399982ffe60ea346117f393784e213acf77b55
Author: Michael Schroeder <mls@xxxxxxx>
Date: Mon Aug 17 15:20:08 2009 +0200

- map missing vendor to empty string
---
src/policy.c | 13 ++++++++-----
src/solvable.c | 3 ++-
2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/policy.c b/src/policy.c
index 713c193..5b5032a 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -417,19 +417,22 @@ int
policy_illegal_vendorchange(Solver *solv, Solvable *s1, Solvable *s2)
{
Pool *pool = solv->pool;
+ Id v1, v2;
Id vendormask1, vendormask2;

if (solv && solv->vendorCheckCb)
{ /* The application is responsible for */
return solv->vendorCheckCb(solv->pool, s1, s2);
}
-
- if (s1->vendor == s2->vendor)
+ /* treat a missing vendor as empty string */
+ v1 = s1->vendor ? s1->vendor : ID_EMPTY;
+ v2 = s2->vendor ? s2->vendor : ID_EMPTY;
+ if (v1 == v2)
return 0;
- vendormask1 = pool_vendor2mask(pool, s1->vendor);
+ vendormask1 = pool_vendor2mask(pool, v1);
if (!vendormask1)
- return 0;
- vendormask2 = pool_vendor2mask(pool, s2->vendor);
+ return 1; /* can't match */
+ vendormask2 = pool_vendor2mask(pool, v2);
if ((vendormask1 & vendormask2) != 0)
return 0;
return 1;
diff --git a/src/solvable.c b/src/solvable.c
index 722b82d..22f8df1 100644
--- a/src/solvable.c
+++ b/src/solvable.c
@@ -485,7 +485,8 @@ solvable_identical(Solvable *s1, Solvable *s2)
return 0;
if (s1->evr != s2->evr)
return 0;
- if (s1->vendor != s2->vendor)
+ /* map missing vendor to empty string */
+ if ((s1->vendor ? s1->vendor : 1) != (s2->vendor ? s2->vendor : 1))
return 0;

/* looking good, try some fancier stuff */
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages