Re: Specfile - Upgrade - Check if the old and the new package versions are the same

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Dne 30. 03. 23 v 2:54 Simon Pichugin napsal(a):
Hi folks,
I've spent some time experimenting and trying to implement something like this ($subject):

During `%preun servers`:

    export OLD_VERSION="$(rpm -qa openldap | awk -F- '/^openldap/ && split($2,ver,/\./) >= 1 {print ver[1] "." ver[2] "." ver[3]}')"

Then, during `%post servers`

    if [ $1 -lt 2 ] || [ "%{major_version}.%{minor_version}" = "${OLD_VERSION}" ] ; then
        # do something


I wonder what the "do something" is, because comparing versions is almost always the wrong choice IMHO.

BTW there are "vercmp(v1, v2)" and "ver(evr), ver(e, v, r)" Lua functions for EVR comparisons.


Vít


    fi

I understand that it's not the correct way... Could you please suggest how something like this can be achieved? (during the upgrade - check if the old and the new package versions are the same)

Kind Regards,
Simon

_______________________________________________
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

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux