#!/bin/sh set -e . /usr/share/debconf/confmodule db_version 2.0 case "$1" in configure|reconfigure) # Get ALSA_PNP db_get alsa-source/has_pnp if [ "$RET" = "false" ]; then NOPNP=y fi # Get ALSA_DEBUG db_get alsa-source/debug if [ "$RET" = "true" ]; then DEBUG=y fi # Get ALSA_CARDS db_get alsa-source/cards_to_be_built || : # The following assumes that 'all' is the first item in the list! CARDS="$( echo "$RET" \ | sed -e 's/^all,.*/all/' )" # Get ALSA_CARD_OPTIONS if [ -f /etc/alsa/alsa-source.conf ] ; then eval "$(grep -E '^[[:space:]]*ALSA_CARD_OPTIONS="[^"'"'"']*"[[:space:]]*$' /etc/alsa/alsa-source.conf)" fi # Write new /etc/alsa/alsa-source.conf [ -e /etc/alsa ] && [ ! -d /etc/alsa ] && rm -f /etc/alsa [ -d /etc/alsa ] || mkdir /etc/alsa sed -e "s%^ALSA_NOPNP=.*%ALSA_NOPNP=\"$NOPNP\"%" \ -e "s%^ALSA_DEBUG=.*%ALSA_DEBUG=\"$DEBUG\"%" \ -e "s%^ALSA_CARDS=.*%ALSA_CARDS=\"$CARDS\"%" \ -e "s%^ALSA_CARD_OPTIONS=.*%ALSA_CARD_OPTIONS=\"$ALSA_CARD_OPTIONS\"%" \ /usr/share/alsa-source/alsa-source.conf \ > /etc/alsa/alsa-source.conf ;; abort-upgrade|abort-remove|abort-deconfigure) : # Nothing to do because we didn't do anything in the prerm ;; *) echo "postinst called with unknown argument \`$1'" >&2; exit 1 ;; esac #DEBHELPER# db_stop || :