[Yum-devel] rangeCompare() incorrectly discards Epoch from provides
Ville Skyttä
ville.skytta at iki.fi
Sat Jun 5 18:34:54 UTC 2010
Hello,
This is the post I referred to in my previous compareEVR() patch explanation.
See the attached patch (just for discussion purposes for now).
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). Now, I'm not aware
of a case where this would actually fail completely within yum which may
coerce None Epochs to '0' in all paths that lead to calling rangeCompare()
thus circumventing the issue, but it sure does fail if one looks at it as a
API function, and it also actually does fail for me in rpmlint where I've
pretty much copy-pasted the corresponding functions (to avoid a yum
dependency), and None Epochs are not coerced to 0 before calling them.
So, the simple (and correct, I still believe) approach I thought of was to
never touch the Epoch of the provides side, which is there as the first hunk
of the attached patch. This fixes the above case, but causes failures in
cases where a requires tuple with its flags != None but EVR = (None, None,
None) gets passed to the rangeCompare checks (see comments in the attached
patch). I don't think I've ever seen such a dependency, and it doesn't make
sense to me so I don't know how to start fixing the now failing test cases,
except by simply removing the last 10 (undefined behavior if you ask me, or
can you provide examples where such reqtuples are valid and need to be
supported?) and digging into the first three for which I have a hunch this
patch just reveals a bug in the test suite and does not introduce one in the
actual yum code.
Regarding the previous compareEVR() patch I sent, after the provides side is
no longer touched as a result of the attached patch, a lot of other test cases
(not only rangeCompare()) started failing, and that patch got those fixed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rangecompare-none.patch
Type: text/x-patch
Size: 3725 bytes
Desc: not available
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20100605/0c38d760/attachment.bin>
More information about the Yum-devel
mailing list