Ludwig Nussel
Am 26.05.2015 um 21:23 schrieb Yamaban:
On Tue, 26 May 2015 21:10, Dmitriy Perlow
wrote: I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails.
Any tips please?
Hi, Dmitriy
If you are sure that ALL files in /usr/share/%name are replaced, I'd use a %preinstall scriptlet to remove the whole dir, just to be sure.
Necessary for this: your package "owns" (brings) the /usr/share/%name directory, and all the files in it.
Thinking more on it, maybe the following as %preinstall scriptlet would be better / cleaner:
[code] #!/usr/bin/sh # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive PATH=/usr/bin/:$PATH # no dir, nothing to do test -d /usr/share/%name || exit files=`rpm -ql %name|grep /usr/share/%name|tr ' ' '?'|sed 's,/usr/share/%name/,./,'` # no files, nothing to do test -z $files && exit # change into dir, just to make sure cd /usr/share/%name test -n $files && rm $files #EOF [/code]
Wtf? Don't do that. If the files in /usr/share/%name are owned by rpms they will be removed if all owners are uninstalled.
But not when updated.
That's a core job of rpm. There is no need for such ugly scripts.
When package is updated rpm just will (install new one) (not (remove old one and install new one))!
cu Ludwig
-- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org