File: alsa-source.postinst

package info (click to toggle)
alsa-driver 1.0.13-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 20,108 kB
  • ctags: 50,477
  • sloc: ansic: 319,881; sh: 32,930; makefile: 2,015; python: 1,527; perl: 1,316; xml: 896; awk: 66
file content (52 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download | duplicates (4)
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

#DEBHELPER#

db_stop || :