#!/bin/sh set -e # This is to handle upgrading from old versions of debconf. If the # file doesn't exist yet, this package is being preconfiged, and # we might as well just exit and wait until the postinst # runs the config script. if [ ! -e /usr/share/debconf/confmodule ]; then exit fi . /usr/share/debconf/confmodule db_version 2.0 db_capb escape backup # if the cdebconf frontend hasn't been set yet, try to pick the old debconf one, # and set the equivalent, or a fallback. db_fget cdebconf/frontend seen || true if [ "$RET" = false ]; then db_get debconf/frontend || RET="" if [ -n "$RET" ]; then case "$RET" in Readline)db_set cdebconf/frontend text;; Dialog)db_set cdebconf/frontend newt;; Gnome)db_set cdebconf/frontend gtk;; Kde)db_set cdebconf/frontend newt;; Editor)db_set cdebconf/frontend newt;; Noninteractive)db_set cdebconf/frontend none;; esac db_fset cdebconf/frontend seen true fi fi newchoices="`ls /usr/lib/cdebconf/frontend |sed -e "s/\.so//g"` none" for choice in $newchoices; do db_metaget cdebconf/frontend/$choice description || RET="" if [ -n "$RET" ]; then echoice="$RET" if [ -z "$choices" ]; then choices="$choice" echoices="$echoice" else choices="$choices, $choice" echoices="$echoices, $echoice" fi db_metaget cdebconf/frontend/$choice extended_description || RET="" if [ -n "$RET" ]; then if [ -z "$descriptions" ]; then descriptions="$RET" else descriptions="$descriptions\n$RET" fi fi fi done db_subst cdebconf/frontend choices $choices db_subst cdebconf/frontend echoices $echoices db_subst cdebconf/frontend descriptions $descriptions db_beginblock db_input medium cdebconf/frontend || true db_input medium debconf/priority || true db_endblock db_go || true exit 0