简体   繁体   中英

rpm requires range

I currently have two questions:

1) Is it possible to specify a range of a package in a rpm spec file? something like

package >= 1.0.0 and package < 1.0.50 meaning that it will pick up the latest package version closer to 1.0.50

2) Does somebody knows if yum will update to a package to a higher version even if the version specified in the spec file is lower? or is there something to avoid yum to upgrading to a higher version? This is my example to be more clear:

There are two packages in my repo: package-1.0.5-1 package-2.0.10-1

and if my spec file for package! has the following requires Requires: package > 1.0.5

When I do yum to install of packageA this means that it will install the higher version of 1.0.5 version or it will assume 2.0.10 is higher and will install that ? What I want to achieve is some sort of telling my package that just install as high as 1.0.5 release is and don't skip to the 2.x version.

I hope I made my self clear. Thanks for any tip or response you can give me

I don't see why you cannot specify the range, you may need to enter it on two lines of the spec file.

However, for the second question, yum will likely attempt to install 2.0.10 when asked to upgrade, and then complain about the conflict/requires (you didn't specify what the range was for). So it's going to annoy the users.

One solution, if you have control of the target package, is to have version 2 named package2-2.0.10 which happens a lot. As far as rpm/yum is concerned, that's a totally different package and won't be seen as an option past package-1.0.50 .

See this wiki page for some more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM