"Requires" range

Florian Festi ffesti at redhat.com
Tue Sep 15 10:12:25 UTC 2015


On 09/15/2015 11:40 AM, Paul wrote:
> Hello. I am packaging some software of which a dependency is either Java
> 1.6.x or 1.7.x. The newer Java 1.8 won't work with it. It's not an
> option (yet) to update the software to work with the newer Java. Now
> that Java 1.8 is available, my current "Requires: java => 1.6.0" needs
> to be changed, because it could pull in 1.8.
> 
> I've looked everywhere online for a couple of days now. One suggestion
> was to have "Requires: >= 1.6.0, java < 1.8.0", but this does not work.

There is no good way to really describe such a version range. Possible
options are:

Requires: java >= 1.6
Requires: java < 1.8

This has the disadvantage that it is satisfied by two two packages one
being < 1.6 and one being > 1.8 and then you package still won't work.
An alternative would be:

Requires: java >= 1.6
Conflicts: java >= 1.8

Or:

Requires: java < 1.8
Conflicts: java < 1.6

This has the disadvantage you cannot install java (depending of the
variant used) < 1.6 or 1.8 in parallel of your package.

The brand new rpm 4.13 could use:
Requires: (java = 1.6 or java = 1.7)

Choose the variant depending on which versions of java you expect to be
available in the repositories.

Florian

-- 

Red Hat GmbH, http://www.de.redhat.com/ Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Michael Cunningham, Michael
O'Neill, Charles Peters


More information about the Rpm-list mailing list