rpmlint
rpmlint copied to clipboard
Fixes for the versioned_dep check
(From http://rpmlint.zarb.org/cgi-bin/trac.cgi/ticket/123, dmueller@…)
below is a partial patch for the versioned dependency problematic. it only handled "=" so far, and even worse, it did not handle prereq requirements at all, given that they were incorrectly read from rpm.
the patch is incomplete as it doesn't handle "<" or "<=" yet, but ">=" is much more widely used than "=" or "<".
Changed 5 years ago by scop
Could you be a bit more verbose about what the problems are (one is the "=" vs ">=", other is prereq), and perhaps provide examples and/or a test case for both?
Changed 5 years ago by anonymous
sure. the testcase is openSUSE python packages. they have the following requires:
python >= 2.5 python < 2.6
the problem is that the requires-on-python check does not detect this as fullfulling the test, because it wants to check for either python = 2.5 or python-base = 2.5. however, as you can see above, we require any 2.5.x version, because they're compatible.
implementing a full blown version parser was not trivial, so I went with a hack that is just good enough to make the above case (and similar ones) work, however not all rpm oddities regarding which version is newer than some other is not implemented as I was too lazy to figure out how exactly it works ;)
Changed 5 years ago by dmueller@…
the prereq thingie is just an obvious bug. prereq is just an additional flag, so if a rpm requirement had the prereq flag set (in addition to the equal or greater than flag), the other flags were lost. The intention of the original coder imho was to just filter out the prereq flag from the flags, since he moves it onto a special prereq list.
follow-up: ↓ 5 Changed 5 years ago by scop
priority changed from major to minor Prereq bit applied, thanks.
But I haven't not applied the other part at least yet because strictly speaking,
Requires: python >= 2.5 Requires: python < 2.6 is an incorrect way to express "requires any python 2.5.x version" because having python 2.4 and python 2.6 installed would satisfy it.
FWIW, Fedora and derivatives use an autogenerated "python(abi) = 2.5" provides and requires for this particular purpose, all python 2.5.x versions provide it and packages placing files in /usr/lib*/python2.5/... get a dependency on it automatically.
in reply to: ↑ 4 Changed 5 years ago by scop
Replying to scop:
But I haven't not applied
s/haven't not/haven't/
Original comment by: scop
- Milestone: 1.5 --> 1.7
Original comment by: scop
- Milestone: 1.7 --> future
Original comment by: scop
fix-versioned-prereq.diff from original ticket: https://gist.github.com/scop/53c410f148860c4884f0