summaryrefslogtreecommitdiffstats
path: root/scripts/postinst-intercepts/update_mandb
blob: f91bafdb117439fa3448fe278856171d5096c155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# SPDX-License-Identifier: MIT
#

set -eu

# Create a temporary man_db.conf with paths to the rootfs, as mandb needs absolute paths
CONFIG=$(mktemp --tmpdir update-mandb.XXXXX)
sed "s:\(\s\)/:\1$D/:g" $D${sysconfdir}/man_db.conf > $CONFIG

mkdir -p $D${localstatedir}/cache/man/

PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${bindir}/mandb --config-file $CONFIG --create

rm -f $CONFIG

chown -R man:man $D${localstatedir}/cache/man/