File: gom.postinst

package info (click to toggle)
gom 0.30.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 924 kB
  • sloc: ansic: 3,021; sh: 1,810; makefile: 36
file content (36 lines) | stat: -rw-r--r-- 1,157 bytes parent folder | download | duplicates (7)
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
#!/bin/sh -e
. /usr/share/debconf/confmodule

# Version <= 0.29.103-6 used this file, not /etc/default/gom. We just delete that silently.
no_auto_init_old=/etc/gom/NO_AUTO_INIT
if [ -e ${no_auto_init_old} ]; then
	rm -f ${no_auto_init_old}
fi

CONFFILE="/etc/default/gom"
if [ ! -e $CONFFILE ] ; then
	echo '# Use debconf to configure this file.' > $CONFFILE
	echo 'auto_init="false"' >> $CONFFILE
	echo 'valid_sound_devices="sound alsa"' >> $CONFFILE
fi

db_get gom/auto_init || true
auto_init="${RET}"
db_get gom/valid_sound_devices || true
valid_sound_devices="${RET}"

cp -a -f $CONFFILE $CONFFILE.tmp

# If the admin deleted or commented some variables but then set
# them via debconf, (re-)add them to the conffile.
test -z "$auto_init" || grep -Eq '^ *auto_init=' $CONFFILE || \
	echo "auto_init=" >> $CONFFILE
test -z "$valid_sound_devices" || grep -Eq '^ *valid_sound_devices=' $CONFFILE || \
	echo "valid_sound_devices=" >> $CONFFILE
	  
sed -e "s/^ *auto_init=.*/auto_init=\"$auto_init\"/" \
	-e "s/^ *valid_sound_devices=.*/valid_sound_devices=\"$valid_sound_devices\"/" \
	< $CONFFILE > $CONFFILE.tmp
mv -f $CONFFILE.tmp $CONFFILE

#DEBHELPER#