File: postinst

package info (click to toggle)
changetrack 3.7-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 168 kB
  • ctags: 22
  • sloc: perl: 279; sh: 239; makefile: 56
file content (42 lines) | stat: -rw-r--r-- 758 bytes parent folder | download
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
#!/bin/sh 

set -e

# Make sure only root can read the repository.
chmod 700 /var/lib/changetrack

# If there exists a default setting already, do not ask any questions.
DEFAULTFILE=/etc/default/changetrack
if [ -r $DEFAULTFILE ]; then
    exit 0
fi

# Source debconf library.
. /usr/share/debconf/confmodule

# The default arguments to changetrack is accumulated here.
DEFAULTS=""

# Ask questions using debconf.
db_go

# Use quiet mode when reporting changes?
db_get changetrack/quiet
if [ "$RET" = "true" ]; then
    DEFAULTS="-q"
fi

# Use unified diffs when reporting changes?
db_get changetrack/unified_diff
if [ "$RET" = "true" ]; then
    DEFAULTS="$DEFAULTS -u"
fi

cat > $DEFAULTFILE <<EOF
# Added by $0
PARAMS="$DEFAULTS"
EOF

#DEBHELPER#

exit 0