[Yum-devel] rangeCompare() incorrectly discards Epoch from provides
Ville Skyttä
ville.skytta at iki.fi
Sun Jun 6 08:13:55 UTC 2010
On Sunday 06 June 2010, James Antill wrote:
> 2. In a version comparison None can be used for any of EVR to mean
> "don't care". Eg:
>
> Requires: foo = 1
>
> ...is satisfied _equally_ by:
>
> Provides: foo = 1
> Provides: foo = 666:1-666
> Provides: foo = 1-666
> Provides: foo = 666:1
I'm fairly certain that you're mistaken. If you disagree, would you mind
providing some command line examples or plain rpm-python code and test
packages that can be used to prove the above?
We've been told for years that missing Epoch is equal to Epoch 0, and rpm
*does* behave like that. Using your examples above (sans the Epochless
Provides because it's clear why those do actually satisfy the Epochless
requirement above) on F-13, see:
http://scop.fedorapeople.org/tmp/
$ rpm -q --provides quux | grep foo
foo = 666:1-666
foo = 666:1
$ rpm -qRp bar-1.0-1.fc13.noarch.rpm | grep foo
foo = 1
# rpm -i bar-1.0-1.fc13.noarch.rpm
error: Failed dependencies:
foo = 1 is needed by bar-1.0-1.fc13.noarch
>>> import os
>>> import rpm
>>> ts = rpm.TransactionSet()
>>> fd = os.open("bar-1.0-1.fc13.noarch.rpm", os.O_RDONLY)
>>> hdr = ts.hdrFromFdno(fd)
>>> os.close(fd)
>>> ts.addInstall(hdr, "bar-1.0-1.fc13.noarch.rpm")
>>> print "UNRESOLVED: %s" % ts.check()
UNRESOLVED: [(('bar', '1.0', '1.fc13'), ('foo', '1'), 8, 0, None)]
...so, "foo = 666:1-666" and "foo = 666:1" do not satisfy "foo = 1". On the
other hand, "foo = 1" and "foo = 0:1" would satisfy it.
> > First, pay attention to the added testcase in packagetests.py:
> >
> > (('foo', 'LT', (None, '1.4.4', None)), ('foo', 'EQ', ('3', '1.2.4',
> > '7')), 0)
> >
> > In human readable form, "Requires: foo < 1.4.4" should _not_ be satisfied
> > by "Provides: foo = 3:1.2.4-7" (or the corresponding NEVR).
>
> Which means that this is the same as saying:
I disagree with them being the same, see below.
> "Requires: foo < 3:1.4.4" should _not_ be satisfied by "Provides: foo =
> 3:1.2.4-7"?
>
> ...which, I assume you'd not agree with.
No, I wouldn't agree with that. But I also think it's *not* the same thing in
rpm. I believe what you're describing is the epoch promotion behavior in rpm
which IIRC was the only way how things worked a long time ago, but I believe
nowadays (since rpm 4.4 or something) epoch promotion is off (or in other
words, nopromote is on) by default, meaning missing == 0. And I believe my
example packages and code above prove it.
More information about the Yum-devel
mailing list