This file is indexed.

postinst is in man-db 2.6.7.1-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
set -e

. /usr/share/debconf/confmodule
db_version 2.0

run_mandb () {
    db_get man-db/auto-update
    if [ "$RET" != true ]; then
	echo "Not building database; man-db/auto-update is not 'true'." >&2
	return 0
    fi
    local message="$1"
    shift
    [ "$message" ] && echo "$message" >&2
    # start-stop-daemon isn't available when running from debootstrap.
    perl -e '@pwd = getpwnam("man"); $( = $) = $pwd[3]; $< = $> = $pwd[2];
	     exec "/usr/bin/mandb", @ARGV' -- "$@" || true
}

if [ "$1" = triggered ]; then
    # We don't print a status message here, as dpkg already said
    # "Processing triggers for man-db ...".
    run_mandb "" -pq
    exit 0
fi

[ "$1" = configure ] || exit 0

oldcatdir=/var/catman
catdir=/var/cache/man
maybesetuid='man mandb'
conffile=/etc/manpath.config

db_get man-db/install-setuid

if [ "$RET" = true ]; then
    # man and mandb are to be installed setuid man.
    owner=man:root
    mode=4755
else
    # man and mandb are not to be installed setuid.
    owner=root:root
    mode=0755
fi

for x in $maybesetuid; do
    # No statoverrides available or none exist for us ...
    if [ ! -x /usr/sbin/dpkg-statoverride ] || \
	    ! dpkg-statoverride --list /usr/bin/$x >/dev/null; then
	chown $owner /usr/bin/$x || true
	chmod $mode  /usr/bin/$x
    fi
done

if [ -e /etc/cron.daily/man.moved-by-preinst ]; then
    rm /etc/cron.daily/man.moved-by-preinst
fi
if [ -e /etc/cron.weekly/catman.moved-by-preinst ]; then
    rm /etc/cron.weekly/catman.moved-by-preinst
fi

if [ ! -d $catdir ]; then
    # Make sure the cat directory exists.
    install -d -o man -g root -m 02755 $catdir
fi

build_db=0

if [ ! -f $catdir/index.db ]; then
    # Build the database from scratch on fresh installs.
    build_db=1
fi

if [ $build_db -eq 1 ]; then
    # Chances are we're being run from debootstrap, which will have problems
    # if mandb runs backgrounded for too long (bug #100616).
    run_mandb "Building database of manual pages ..." -cq
else
    # Otherwise, just update the database in the foreground. It's unlikely
    # to take very long, and configuration needs to cover everything that
    # happens when we're triggered.
    run_mandb "Updating database of manual pages ..." -pq
fi



exit 0