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

2023-03-31 Thread Simon Pichugin
On Fri, Mar 31, 2023 at 4:00 AM Vít Ondruch wrote: > Out of curiosity, are you considering also package downgrades? > It's not described in OpenLDAP Upstream docs, so I was not trying to cover that, but... It's a good idea to add the check and do the same safety precautions I do with the upgrade.

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

2023-03-31 Thread Miroslav Suchý
Dne 30. 03. 23 v 20:38 Simon Pichugin napsal(a): When the server package upgrades to the next major version, there are upgrade instructions that need to be performed by the administrator. And what's most important, the server should not start automatically without explicit agreement from the ad

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

2023-03-31 Thread Vít Ondruch
Out of curiosity, are you considering also package downgrades? Vít Dne 30. 03. 23 v 20:38 Simon Pichugin napsal(a): Hi folks, Thank you for the answers! On Thu, Mar 30, 2023 at 1:16 AM Vít Ondruch wrote: I wonder what the "do something" is, because comparing versions is almost alwa

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

2023-03-30 Thread Simon Pichugin
Hi folks, Thank you for the answers! On Thu, Mar 30, 2023 at 1:16 AM Vít Ondruch wrote: > I wonder what the "do something" is, because comparing versions is almost > always the wrong choice IMHO. > When the server package upgrades to the next major version, there are upgrade instructions that ne

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

2023-03-30 Thread Miroslav Suchý
Dne 30. 03. 23 v 10:16 Vít Ondruch napsal(a): 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}

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

2023-03-30 Thread Vít Ondruch
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]

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

2023-03-29 Thread Vitaly Zaitsev via devel
On 30/03/2023 02:54, Simon Pichugin wrote: 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) You should use %triggerun instead: %triggerun -- %{name}

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

2023-03-29 Thread Dan Čermák
Hi Simon, On March 30, 2023 12:54:49 AM UTC, Simon Pichugin wrote: >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 {

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

2023-03-29 Thread Simon Pichugin
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