postinst is in alsa-source 1.0.25+dfsg-0ubuntu4.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/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
db_stop || :
|