I wonder what the "do something" is, because comparing versions is almost always the wrong choice IMHO.
And what's most important, the server should not start automatically without explicit agreement from the administrator.
But we don't need to do that when the package upgrade happens with just a release number bump (2.6.4-1 -> 2.6.4-2).
That's what I'm trying to solve with the RPM tools.
BTW there are "vercmp(v1, v2)" and "ver(evr), ver(e, v, r)" Lua functions for EVR comparisons.
I second Vít. Comparing version is wrong approach. IMO.
1) it is definitelly bad idea if you call `rpm -qa` because rpm is not reentrant. So calling rpm from scriptlet may work, but one day it will do something really bad.
2) you did not take in consideration epoch. So it may cause you a problem few years in future.
3) such decision should be always based on capabilities. Does such config exists? Is some variable in config set? Or not set?
In your case, I would check for existence of /etc/openldap/migrated_from_version_1 file. And if it does not exist then do the migration and when done, touch this file. And you should own this file as %ghost.
Thank you! I'll look into that option, and we'll see how it goes. :)
_______________________________________________Miroslav
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
_______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue