[Fedora-packaging] how to check on upgrade rpm

Léon Keijser keijser at stone-it.com
Thu Dec 17 19:05:27 UTC 2009


On Thu, 2009-12-17 at 07:41 -0600, Jon Ciesla wrote:
> Check this out:
> 
> http://docs.fedoraproject.org/drafts/rpm-guide-en/ch09s04.html#id2972291
> 
> You can create a script to test if it's an upgrade and if it is, remove 
> the install.  Such as:
> 
> %post
> 
> if [ "$1" = 2 ]; then
> 
> rm -rf /path/to/install/thingy
> 
> fi
> 
> exit 0
> 

I didn't know about that yet, thanks! Works like a charm. The %ghost
line made yum complain a lot when installing the rpm, so i just left the
subdir out and included everything in the toplevel dir. Don't know why i
specified each subdir seperately in %files. 


-- 
Léon




More information about the Fedora-packaging mailing list