RPM runs %post, yum does not ...

Klaus Steden klaus.steden at thomson.net
Fri Nov 4 03:50:49 UTC 2005


Hello,

This one has me scratching my head a little bit ... I thought I'd throw it out
here, since you guys have good answers for other questions I've asked.

I'm making my own RPMs for some software we get as binary-only. The '%post'
section of the RPM is extremely simple, and involves making a symlink in /usr
from the newly-installed software directory to a simpler name.

The '%pre'/'%preun' sections make sure that the symlink is removed when the
package is uninstalled.

Here's what is confusing me (and I blame my inexperience with the RPM format),
but I'm hoping someone can clear up for me ...

When using 'rpm -i', the %post section executes successfully.

When using 'rpm -U', the %post section executes, but does nothing (I've stuck
a 'set -x' in it to make sure it tells me it ran).

What gives?

I've attached the %pre/%preun/%post sections below:

-- cut here --
%pre
if [ -e /usr/hfs8.0 ]; then
    unlink /usr/hfs8.0
fi

%post
cd /usr && ln -s hfs8.0.354 hfs8.0

%preun
if [ -e /usr/hfs8.0 ]; then
    unlink /usr/hfs8.0
fi
-- cut here --

Why would this run properly when installing, but not when upgrading?

thanks,
Klaus




More information about the Kickstart-list mailing list