[Fedora-packaging] Upgrade scriptlet

Ville Skyttä ville.skytta at iki.fi
Tue Apr 19 21:50:52 UTC 2011


On 04/17/2011 10:12 AM, Michael Schwendt wrote:
> On Sat, 16 Apr 2011 11:11:28 +0200, TM wrote:
> 
>> Hi,
>>
>> when I want a script to be run during package upgrade, is it better to
>> call it in %postun if $1>=1, or to call it in
>> %post if $1>1? Is one of the two possibilities preferred?
> 
> It depends on what the script is supposed to do and whether files from the
> old pkg are still around and may be needed by the script/program or may
> confuse the script/program. When %postun is executed, any old pkg files
> have been removed already.

One important additional consideration is that when using %post, you can
control what happens in your new package.  With %postun, it's the old
package's %postun that runs on upgrades, which could be a problem and
something that can be hard to work around in the new package.  One
example of such a problem from this list yesterday:

http://lists.fedoraproject.org/pipermail/packaging/2011-April/007744.html


More information about the packaging mailing list