Red Hat Bugzilla – Bug 1287594
[RFE] Requirements for the same package with versions in between
Last modified: 2016-11-16 03:26:30 EST
Description of problem:
We have specified following BR in rubygem-actionmailer :
BuildRequires: rubygem(minitest) >= 5.1.0
BuildRequires: rubygem(minitest) <= 5.3.1
Since there is implicit AND between lines, one would expect, that this will install package rubygem(minitest) >= 5.1.0 AND rubygem(minitest) <= 5.3.1, but surprisingly, this  is what DNF installs:
DEBUG util.py:393: rubygem-minitest noarch 5.8.1-1.fc24 build 42 k
DEBUG util.py:393: rubygem-minitest4 noarch 4.7.0-5.fc23 build 43 k
Version-Release number of selected component (if applicable):
Steps to Reproduce:
rubygem-minitest.noarch 5.8.1-1.fc24 and rubygem-minitest4.noarch 4.7.0-5.fc23 are installed
The build should fail, since there is no rubygem-minitest package with version in between 5.1.0 and 5.3.1
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.
More information and reason for this action is here:
Requires are matched against provides not package names (only). I assume that rubygem-minitest4-4.7.0-5.fc23 Provides: rubygem-minitest = 4.7.0-5
This means that both Requires are fulfilled with those two packages. Unfortunately there is no mean in RPM right now to link the two Requires: lines together in a way that they have to be fulfilled with one exact package.
RPM threats those dependencies as different requirements.
I think we need to introduce syntax for:
5.1.0 <= FooBar <= 5.3.0
One work around is adding
BuildConflicts: rubygem(minitest) < 5.1.0
and may be even
BuildConflicts: rubygem(minitest) > 5.3.1
Note that this has not quite the same semantics as a Requirement for a version range as it actively prevents versions outside of the range being installed which in theory could create additional problems. It should just work for most cases, though.
*** This bug has been marked as a duplicate of bug 1389871 ***