summaryrefslogtreecommitdiff
path: root/debian/mdadm.config
diff options
context:
space:
mode:
authormadduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464>2006-09-17 11:05:18 +0000
committermadduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464>2006-09-17 11:05:18 +0000
commit2f4bf3f604f2d63bf86b85a0369b324363840e50 (patch)
treebf809a3115cd4f986c034f9d05a61583a8ea9c2e /debian/mdadm.config
parent0b12df2997c3e5ab56426ee40f837f523a53da9c (diff)
defer configuration when debconf is too old
Diffstat (limited to 'debian/mdadm.config')
-rw-r--r--debian/mdadm.config26
1 files changed, 7 insertions, 19 deletions
diff --git a/debian/mdadm.config b/debian/mdadm.config
index aa71de34..62f8bdc4 100644
--- a/debian/mdadm.config
+++ b/debian/mdadm.config
@@ -6,6 +6,12 @@
# $Id$
#
+# we need debconf-escape. Without it, defer the configuration.
+if [ ! -x "$(command -v debconf-escape 2>/dev/null)" ]; then
+ echo 'I: mdadm: debconf backend too old, defering configuration...' >&2
+ exit 0
+fi
+
. /usr/share/debconf/confmodule
# see #369953 for ordering
set -eu
@@ -79,28 +85,10 @@ get_initrdstart() {
db_capb escape
-if [ -x "$(command -v debconf-escape)" ]; then
- debconf_escape()
- {
- debconf-escape $@
- }
-else
- debconf_escape()
- { # copied from debconf 1.4.72:
- perl -e '
- while (<>) {
- s/\\/\\\\/g;
- s/\n/\\n/g;
- print;
- }
- '
- }
-fi
-
msg=intro; suffix=''; error=0
while true; do
db_metaget mdadm/initrdstart_msg_${msg} extended_description || :
- db_subst mdadm/initrdstart msg "$(echo -e "${RET}${suffix}" | debconf_escape -e)"
+ db_subst mdadm/initrdstart msg "$(echo -e "${RET}${suffix}" | debconf-escape -e)"
ret=0; db_input low mdadm/initrdstart || ret=$?
db_go