<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><div><div><div><div><div>Hi<br><br></div>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.<br><br></div>i.e if present version is 1.0 or higher -> do something<br><br></div><div>else<br></div><div><br></div>if present present version is < 1.0 -> do something else.<br><br></div>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?<br><br></div>Any pointers would be great.<br><br></div><span style="font-family:arial,sans-serif;font-size:13px">regards</span><br></div>