Browse Source

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
tags/4.1.0
Alexander Kislitsky 3 years ago
parent
commit
2d24a9dbe3
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      fuel_plugin_builder/templates/v3/build/plugin_rpm.spec.mako

+ 8
- 1
fuel_plugin_builder/templates/v3/build/plugin_rpm.spec.mako View File

@@ -44,7 +44,14 @@ ${ preinstall_hook }
44 44
 ${ postinstall_hook }
45 45
 
46 46
 %%preun
47
-${ uninstall_hook }
47
+# Values of $1:
48
+# install:      (N/A)
49
+# upgrade:      1
50
+# uninstall:    0
51
+if [ $1 -eq 0 ]; then
52
+    ${ uninstall_hook }
53
+fi
54
+
48 55
 
49 56
 %%files
50 57
 /var/www/nailgun/plugins/${ name }

Loading…
Cancel
Save