We shouldn't execute uninstall.sh on plugin upgrade

When package is upgraded the following steps are perfored:
- Run the %pre section of the RPM being installed.
- Install the files that the RPM provides.
- Run the %post section of the RPM.
- Run the %preun of the old package.
- Delete any old files not overwritten by the newer version.
  (This step deletes files that the new package does not require.)
- Run the %postun hook of the old package.

uninstall_hook should be executed only when package removing is
performed. Otherwise in case of upgrade plugin changes made in
post-install.sh can be removed by unistall.sh

Change-Id: Idba866be2556aacc9ac0abeff67afcf34f02d93b
Closes-Bug: #1564123
This commit is contained in:
Alexander Kislitsky 2016-04-06 17:54:16 +03:00
parent a6f3a6a3fd
commit 2d24a9dbe3
1 changed files with 8 additions and 1 deletions

View File

@ -44,7 +44,14 @@ ${ preinstall_hook }
${ postinstall_hook }
%%preun
${ uninstall_hook }
# Values of $1:
# install: (N/A)
# upgrade: 1
# uninstall: 0
if [ $1 -eq 0 ]; then
${ uninstall_hook }
fi
%%files
/var/www/nailgun/plugins/${ name }