summaryrefslogtreecommitdiffstats
path: root/debian/ceph-common.preinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:29 +0000
commitdf4528d6668ab18e40584fe540355bdfba0fb6dd (patch)
treef1bfdcb6485edff853369405dd5423c662c47345 /debian/ceph-common.preinst
parentAdding upstream version 14.2.21. (diff)
downloadceph-df4528d6668ab18e40584fe540355bdfba0fb6dd.tar.xz
ceph-df4528d6668ab18e40584fe540355bdfba0fb6dd.zip
Adding debian version 14.2.21-1.debian/14.2.21-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/ceph-common.preinst')
-rw-r--r--debian/ceph-common.preinst29
1 files changed, 29 insertions, 0 deletions
diff --git a/debian/ceph-common.preinst b/debian/ceph-common.preinst
new file mode 100644
index 00000000..ef14f1eb
--- /dev/null
+++ b/debian/ceph-common.preinst
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -e
+
+# Custom dpkg-maintscript-helper type function to deal with
+# nested /etc/default/ceph/ceph
+prepare_mv_ceph_defaults() {
+ local md5sum old_md5sum
+ md5sum="$(md5sum "/etc/default/ceph/ceph" | sed -e 's/ .*//')"
+ old_md5sum="$(dpkg-query -W -f='${Conffiles}' "ceph-common" | \
+ sed -n -e "\'^ /etc/default/ceph/ceph ' { s/ obsolete$//; s/.* //; p }")"
+ if [ "$md5sum" = "$old_md5sum" ]; then
+ mv -f "/etc/default/ceph/ceph" "/etc/default/ceph/ceph.dpkg-remove"
+ mv -f "/etc/default/ceph" "/etc/default/ceph.dpkg-backup"
+ fi
+}
+
+case "$1" in
+ upgrade|install)
+ if [ -d /etc/default/ceph ] && [ -n "$2" ] &&
+ dpkg --compare-versions -- "$2" le-nl 10.2.1-0ubuntu1; then
+ prepare_mv_ceph_defaults
+ fi
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0