[opensuse-packaging] rpm %post and %postun react differently then I expected

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 All, I have a question. I've packaged a package that uses scripts in %post and %postun When do zypper install <package> and a zypper update and a rpm -i <package> and a rpm -U <package> I exactly see what is described in http://www.stearns.org/rsync-backup/rsync-backup.spec <quote> ##Here are the scripts run at first install, in this order: ##pre - 1 - first install ##post - 1 - first install # ##Here are the scripts run during an upgrade, in this order: ##pre - 2 - upgrade ##post - 2 - upgrade ##preun - 1 - upgrade ##postun - 1 - upgrade # ##Here are the scripts run at final erase, in this order: ##preun - 0 - final erasure ##postun - 0 - final erasure </quote> I don't understand why during an upgrade %postun is run after %post? As I expect %postun = post uninstall? I would expect that during an upgrade the %preun and %postun would be run before %pre and %post Can someone please explain, why it's like this? Regards, Joop. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iF4EAREIAAYFAktx7/8ACgkQajPXGT73MfhkSgEAitESv4COVKH2fJVveaIFLpsP RVQHJcfDX7NnSCr0du0BAORRYyZWygZTWzDIbutW0BALDCGyEKrOUlM2tbld3fdO =Ekoy -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org

On 02/10/2010 12:30 AM, Joop Boonen wrote:
Here's the order of scriptlets run on upgrade: http://en.opensuse.org/Packaging/Scriptlet_Snippets#Scriptlet_Ordering First, the new package is being installed and then the unneeded files from the old package are uninstalled. If RPM uninstalled the old package first and then installed the new package, there could be a slight time window when no files are present on system and this could break running applications. This does not happen otherwise. -- Best Regards / S pozdravom, Pavol RUSNAK SUSE LINUX, s.r.o openSUSE Boosters Team Lihovarska 1060/12 PGP 0xA6917144 19000 Praha 9, CR prusnak[at]suse.cz http://www.suse.cz -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (2)
-
Joop Boonen
-
Pavol Rusnak