Results 1 to 3 of 3
Hi all I'm building a certain RPM package that must require an old version of that same package in order to be installed/upgraded. Is this possible? For example: For a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-22-2010 #1
- Join Date
- Dec 2006
RPM: package requires old version of same package - possible?
I'm building a certain RPM package that must require an old version of that same package in order to be installed/upgraded. Is this possible?
For a package foo v5, somewhere in the spec file:
"Requires: foo >= 4"
I'm declaring this on the Requires tag of the spec file, but when I try to install or upgrade the package (without having the previous required version installed) I get no dependency error! As for other dependencies it all works fine.
If, instead, I create a package named "bar" that "Requires: foo >= 4", when installing I do get the expected dependency error. I'm thinking it's not possible to require an old version of the same package. Is it so? Any thoughts on this?
Thanks in advance!
- 11-22-2010 #2
I dont think it is possible.
The package v5 you are installing, does *provide* a version >= 4 at install time, thus fullfilling the requirement.
I am not so sure, that a dependency on an older package is a good way.
RPMs define a system (so to say).
So, regardless if you install a new box or update an existing one, both should have the same files (binary, library, man, etc) and same version.
This way you can guarantee consistency throughout your systems.
What you maybe can do:
1) split your RPM into v4 and v5 version, and let RPMs have dependency on the correct version
2) or maybe check in the %pre or %post section for needed (data?) files and at least complain if nothing is found
Cant really recommend something specific, as I dont know enough about the exact problem.
But from the two approaches: 2) is the crappy oneYou must always face the curtain with a bow.
- 11-22-2010 #3
- Join Date
- Dec 2006
Thank you for your tips Irithori!
If you or anyone have better suggestions for doing this - packaging databases - I'd appreciate!
I'm not sure I totally understood your approach 1) (and, like you, I'm not very fond of solution 2)). But, based on what I thought you said , I'm now trying this, relying on full names instead of versions:
It's not a fancy solution and it requires a lot of package version/naming discipline.. but.... I think it will do the job. What do you think?