diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:46:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:46:10 +0000 |
commit | 7050cdb205fd1b1b847c148092a8548f00a061c0 (patch) | |
tree | 05a497ffd12f14405445c3288085e228f4e8579f /debian/ceph-common.preinst | |
parent | Adding upstream version 16.2.11+ds. (diff) | |
download | ceph-7050cdb205fd1b1b847c148092a8548f00a061c0.tar.xz ceph-7050cdb205fd1b1b847c148092a8548f00a061c0.zip |
Adding debian version 16.2.11+ds-2.debian/16.2.11+ds-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/ceph-common.preinst')
-rw-r--r-- | debian/ceph-common.preinst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/debian/ceph-common.preinst b/debian/ceph-common.preinst new file mode 100644 index 000000000..ef14f1eb1 --- /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 |