[Rpm-maint] upgrade process

Tom Brown tom at ng23.net
Fri Mar 13 16:31:31 UTC 2009


> There are two ways to detect if it's an update or not:
>
> 1) check $1 in the postun script, it contains the number of left
>    packages with the same name. Thus, if it's zero, it's a delete,
>    otherwise it's an update
> 2) check for the existance of some crucial file. If it's no longer
>    there, it's a delete.
>
> Method 2) has the advantage that it also works with package renames.
>
> The real problem you have is that there's no way to fix the bugs in
> scriptlets of the installed packages.
>
>   

thanks - i put this in the %postun

# Only remove symlink if we are erasing package
if [ $1 = 0 ]; then
    if [ -h /usr/java/latest ] ; then
            rm -f /usr/java/latest ;
    fi
fi

but on an upgrade the symlink still got wiped out. I was sure that 
looked right when compared to

          install   erase   upgrade  reinstall
%pre         1        -         2         2
%post        1        -         2         2
%preun       -        0         1         -

but seemingly not!
%postun      -        0         1         -




More information about the Rpm-maint mailing list