[Rpm-maint] upgrade process

Mark Hatle mark.hatle at windriver.com
Fri Mar 13 13:06:41 UTC 2009


Order:

New packages files installed
Old package files removed (ones not already overwritten by the install)
postun run
post run

What you are missing in your script is the check to see if this is an upgrade or 
fresh install process.

(From memory, this might be wrong)
if [ $1 = 1 ]; then
   [Install - not upgrade]
fi

if [ $1 = 0 ]; then
   [Package remove operation]
fi

Check the rpm manual for the exact semantics.

--Mark

Tom Brown wrote:
> When an rpm is upgraded is the existing package removed before or after 
> the post section of the package that is replacing it?
> 
> I ask because in my %post of a package a symlink gets created. This 
> symlink is also removed if the package is removed so in the %postun
> 
> If i install the rpm the symlink is fine but if i upgrade the package 
> the symlink is no longer there so i wonder if its being caught by the 
> removal of the preceding package?
> 
> any clues?
> 
> thanks
> 
> %post
> 
> if [ -h /usr/java/latest ] ; then
>        rm -f /usr/java/latest ;
> fi
> 
> ln -s /usr/java/jdk%{version} /usr/java/latest
> 
> %postun
> 
> if [ -h /usr/java/latest ] ; then
>        rm -f /usr/java/latest ;
> fi
> _______________________________________________
> Rpm-maint mailing list
> Rpm-maint at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-maint



More information about the Rpm-maint mailing list