Possible to check version of package in %pre/%prerun -> -> changes outcome of install ?

Morgan Cox morgancoxuk at gmail.com
Tue Nov 4 14:48:40 UTC 2014


Thank you for the response Panu!

Actually we solved this by calling a python script to check the version


On 4 November 2014 08:22, Panu Matilainen <pmatilai at laiskiainen.org> wrote:

> On 10/07/2014 11:00 AM, Morgan Cox wrote:
>> Hi
>> I am trying to build an RPM that when installed/upgraded checks the
>> present version of the package and depending on if the present version
>> is a certain version or higher -> do something if lower -> do something
>> else.
>> i.e if present version is 1.0 or higher -> do something
>> else
>> if present present version is < 1.0 -> do something else.
>> I have been told that I shouldn't use rpm command (i.e 'rpm-qa')  in the
>> inside the %pre or %prerun  scriptlet as this can cause an RPM - how can
>> I query the existing version in the rpmbuild/spec file?
> Doing rpm queries from inside rpmbuild isn't any more recommended than
> install-time scriptlets, for similar reasons, and it wouldn't help anyway
> if you need to do such decisions at install-time.
> What you can do from rpm scriptlets is try figuring out the version by
> other means, such as testing existence/naming of files of the other
> package, or executing some test-commands (lot of software has some means of
> outputting its version via --version or such cli switch)
>         - Panu -
> _______________________________________________
> Rpm-list mailing list
> Rpm-list at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20141104/70bd09cb/attachment.html>

More information about the Rpm-list mailing list