[Fedora-packaging] Conditional comparision doesn't work

Michael Schwendt mschwendt at gmail.com
Sat Apr 9 18:36:07 UTC 2011


On Sat, 9 Apr 2011 12:52:51 -0500, Bruno wrote:

> > $ rpmdev-vercmp 4.8.10 4.8.3
> > 0:4.8.10-None is newer
> 
> Would it be possible to run something like:
> rpmdev-vercmp 4.8.10 4.8.3 > /dev/null;echo $?
> in the spec file and compare the output to 0, 11 or 12?

Sounds doable.

Be prepared to deal with a little bit of extra burden, however.

When running "rpm" inside the spec file to fill macros with the EVR of
installed packages, expect this to break during src.rpm rebuild outside
of the buildroot (and when the rpms to be queried are not available yet).
It is not uncommon for packagers to test their conditional spec files only
on a system where the queried/grepped files are available.

Plus, running "rpm" inside a spec file is not guaranteed to work.
Because depending on the used build-system, the RPM database found in the
buildroot may be incompatible due to host/guest RPM differences - as a result
of using an external RPM when populating the buildroot.


More information about the packaging mailing list