aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2024-05-14 14:23:09 +0200
committerOliver Smith <osmith@sysmocom.de>2024-05-14 14:23:09 +0200
commitd1bec8f61190bab9b66b67bbe23387ad144484a5 (patch)
tree26c7178169a265e69fbd106f2212dd63aab522ad
parenta59d264d59f970a5918ec3c84f77091e0e64fc94 (diff)
debian/postinst: add checks, be verboseHEADmaster
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
-rwxr-xr-xdebian/postinst6
1 files changed, 4 insertions, 2 deletions
diff --git a/debian/postinst b/debian/postinst
index 680cb2f..3353c37 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -16,8 +16,10 @@ case "$1" in
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