summaryrefslogtreecommitdiffstats
path: root/debian/slapd.prerm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:54:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:54:14 +0000
commit83da7a0ac93decce70c1a02b0739020d8e2b69fd (patch)
tree0c298e82da8861a97aa152863f30eb4af5b80b37 /debian/slapd.prerm
parentAdding upstream version 2.6.7+dfsg. (diff)
downloadopenldap-83da7a0ac93decce70c1a02b0739020d8e2b69fd.tar.xz
openldap-83da7a0ac93decce70c1a02b0739020d8e2b69fd.zip
Adding debian version 2.6.7+dfsg-1~exp1.debian/2.6.7+dfsg-1_exp1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/slapd.prerm')
-rwxr-xr-xdebian/slapd.prerm43
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/slapd.prerm b/debian/slapd.prerm
new file mode 100755
index 0000000..e6120a3
--- /dev/null
+++ b/debian/slapd.prerm
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+# This will be replaced with debian/slapd.scripts-common which includes
+# various helper functions and $OLD_VERSION and $SLAPD_CONF
+#SCRIPTSCOMMON#
+
+# dh_installinit's --error-handler option requires that the
+# error-handling function be defined in the prerm and postinst
+# scripts. This function is declared here as a formality, but we do
+# not want to ignore the init script failure during the prerm phase.
+ignore_init_failure() { # {{{
+ :
+}
+# }}}
+
+#DEBHELPER#
+
+# Dump config and data to LDIF before removing slapd.
+# If a later version is reinstalled without being purged first, the LDIF
+# files may be required for the upgrade, and the old slapcat won't be
+# available any more.
+# During an upgrade, the new preinst will be in a better position to
+# control whether dumping is needed.
+
+# If the config is badly broken, slapcat may fail, but this should not
+# prevent the package from being removed or purged.
+set +e
+
+if [ "$MODE" = remove ]; then
+ # scripts-common sets OLD_VERSION incorrectly for remove
+ OLD_VERSION="$(dpkg-query -W -f '${Version}' slapd)"
+
+ dump_config
+ dump_databases
+fi
+
+exit 0
+
+# vim: set foldmethod=marker: