dpkg (1.18.25) stretch; urgency=medium
[dpkg] / debian / dpkg.postinst
CommitLineData
1479465f
GJ
1#!/bin/sh
2# See deb-postinst(5).
3
4set -e
5
6# Create the database files if they don't already exist
7create_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
19create_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
27case "$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 ;;
40esac
41
42#DEBHELPER#
43exit 0