On Thu, 2007-09-06 at 17:18 -0400, James Antill wrote:
> I've been trying to understand enough of the code+unit tests so I can
> add test cases for all the problems we had with 3.2.1* that I tried to
> get into RHEL-5.1.
> Atm. I've got one thing that might be a bug, and one that I'm jsut
> confused about:
>
> 1. I have:
>
> def testInstallSinglePackageRequireVer3Installed(self):
> po = FakePackage('zsh', '1', '1', None, 'i386')
> po.addRequires('zip', 'GE', ('2', '1.3', '4'))
> self.tsInfo.addInstall(po)
>
> ipo = FakePackage('zip', '1.3', '4', '2', 'i386')
> self.rpmdb.addPackage(ipo)
>
> self.assertEquals('ok', self.resolveCode(self.tsInfo, self.rpmdb))
>
> ...but this fails due to yum/packages.py:matchingPrcos() where:
>
> for (n, f, (e, v, r)) in self.returnPrco(prcotype):
> # But here f == '=':
> [...]
> matched = rpmUtils.miscutils.rangeCompare(
> reqtuple, (n, f, (e, v, r)))
> # So this is ('zip', 'GE', ('2', '1.3', '4')) ('zip', '=', ('2',
> '1.3', '4'))
> # which fails.
>
> ...the following diff fixes the test case for me, but seems hacky:
>
> diff --git a/yum/packages.py b/yum/packages.py
> index d11816e..43fa097 100644
> --- a/yum/packages.py
> +++ b/yum/packages.py
> @@ -277,6 +277,8 @@ class RpmBase(object):
> if reqn != n:
> continue
>
> + if f == '=':
> + f = 'EQ'
> if f != 'EQ' and prcotype == 'provides':
> # isn't this odd, it's not 'EQ' and it is a provides
> # - it really should be EQ
>
Seems like we should have already converted the flag well before this
point. That seems like a good place to fix this problem.
> 2. The second problem I have is that, I can't see how to create a
> correct multi-lib. requires ... the prco list of tuples doesn't contain
> it and yum doesn't seem to take it from the package with the requires
> so:
>
> def testInstallSinglePackageRequireNotProvidedMultiLib(self):
> po = FakePackage('zsh', '1', '1', None, 'x86_64')
> po.addRequires('zip', None, (None, None, None))
> self.tsInfo.addInstall(po)
>
> ipo = FakePackage('zip', '1', '3', None, 'i386')
> self.rpmdb.addPackage(ipo)
>
> # self.assertEquals('err', self.resolveCode(self.tsInfo, self.rpmdb))
>
> ...if the above assert is uncommented it fails. I'm sure I'm doing
> _something_ wrong here, but I can't see what.
what is a 'multilib requires' in this context? There's no way to specify
an arch in a requirement the only such thing is when a library is marked
as (64bit).
Is that what you mean? That's just a string.
-sv
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel