nebula-plugins/gradle-ospackage-plugin

preinst should run during upgrade too

Open

#251 opened on Jun 30, 2017

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Groovy (128 forks)batch import
Hacktoberfest

Repository metrics

Stars
 (388 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

According to the debian policy, preinst is not only run during install, but during upgrade too:

https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s-unpackphase

I propose adding upgrade to the case in preinst.ftl Diff:

diff --git a/src/main/resources/deb/preinst.ftl b/src/main/resources/deb/preinst.ftl
index ffd64af..aeb4622 100644
--- a/src/main/resources/deb/preinst.ftl
+++ b/src/main/resources/deb/preinst.ftl
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 case "\$1" in
-    install)
+    install|upgrade)
         <% commands.each {command -> %>
         <%= command %>
         <% } %>

Contributor guide