osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/36803?usp=email )

Change subject: debian/postinst: add checks, be verbose
......................................................................

debian/postinst: add checks, be verbose

Do not attempt to change permissions/ownership if the package gets
upgraded from a version higher than the next release.

Do not fail if the user deleted the config file.

Be verbose when changing permissions.

Related: OS#4107
Change-Id: I48e8f5d2a36886d28366bef1918f7464a48d2159
---
M debian/postinst
1 file changed, 21 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




diff --git a/debian/postinst b/debian/postinst
index 680cb2f..3353c37 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -16,8 +16,10 @@
                fi

                # Fix permissions of previous (root-owned) install (OS#4107)
-               mkdir -p /var/lib/osmo_dia2gsup
-               chown -R osmocom:osmocom /var/lib/osmo_dia2gsup
+               if dpkg --compare-versions "$2" le "0.3.0"; then
+                       mkdir -p /var/lib/osmo_dia2gsup
+                       chown -R -v osmocom:osmocom /var/lib/osmo_dia2gsup
+               fi
                ;;
 esac


--
To view, visit 
https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/36803?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo_dia2gsup
Gerrit-Branch: master
Gerrit-Change-Id: I48e8f5d2a36886d28366bef1918f7464a48d2159
Gerrit-Change-Number: 36803
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to