Mailinglist Archive: zypp-commit (171 mails)

< Previous Next >
[zypp-commit] <sat-solver> master : - treat missing vendor as empty string in vendorchange check
  • From: Michael Schroeder <mls@xxxxxxx>
  • Date: Wed, 3 Jun 2009 12:54:54 +0200
  • Message-id: <E1MBo7v-0007M2-9Z@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 204f333c5ffe03b5d0c164cda65f298c21eb8d06
Author: Michael Schroeder <mls@xxxxxxx>
Date: Wed Jun 3 12:54:54 2009 +0200

- treat missing vendor as empty string in vendorchange check
---
src/policy.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/policy.c b/src/policy.c
index 0782592..2148b10 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -414,22 +414,25 @@ int
policy_illegal_vendorchange(Solver *solv, Solvable *s1, Solvable *s2)
{
Pool *pool = solv->pool;
+ Id v1, v2;
Id vendormask1, vendormask2;

- if (solv && solv->vendorCheckCb)
+ if (solv->vendorCheckCb)
{ /* The application is responsible for */
- return solv->vendorCheckCb(solv->pool, s1, s2);
+ return solv->vendorCheckCb(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;
+ return 1; /* no class matches */
}


--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages