chiark / gitweb /
lib/dpkg/tarfn.c: Kludge `tar_header_decode' to handle spurious `errno'.
[dpkg] / debian / dpkg.postinst
1 #!/bin/sh
2 # See deb-postinst(5).
3
4 set -e
5
6 # Create the database files if they don't already exist
7 create_database() {
8     admindir=${DPKG_ADMINDIR:-/var/lib/dpkg}
9
10     for file in diversions statoverride status; do
11         if [ ! -f "$admindir/$file" ]; then
12             touch "$admindir/$file"
13         fi
14     done
15 }
16
17
18 # Create log file and set default permissions if possible
19 create_logfile() {
20     logfile=/var/log/dpkg.log
21     touch $logfile
22     chmod 644 $logfile
23     chown root:root $logfile 2>/dev/null || chown 0:0 $logfile
24 }
25
26
27 case "$1" in
28     configure)
29         create_database
30         create_logfile
31         ;;
32
33     abort-upgrade|abort-deconfigure|abort-remove)
34         ;;
35
36     *)
37         echo "$0 called with unknown argument '$1'" 1>&2
38         exit 1
39         ;;
40 esac
41
42 #DEBHELPER#
43 exit 0