summaryrefslogtreecommitdiffstats
path: root/src/tests/mandb-cachedir-tag
blob: 77f21b7caabce4116cb3b126a16f41caa193e3e1 (plain)
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
#! /bin/sh

# Don't create CACHEDIR.TAG in manpath

: "${srcdir=.}"
# shellcheck source-path=SCRIPTDIR
. "$srcdir/testlib.sh"

: "${MANDB=mandb}"

init
fake_config /usr/share/man
mkdir -p "$tmpdir/usr/share/man"
mkdir -p "$tmpdir/usr/dir/man"
mkdir -p "$tmpdir/var/cache/man"
echo "MANDATORY_MANPATH	$abstmpdir/usr/share/man" > "$tmpdir/manpath.config"
echo "MANDATORY_MANPATH	$abstmpdir/usr/dir/man" >> "$tmpdir/manpath.config"
echo "MANDB_MAP $abstmpdir/usr/share/man $abstmpdir/var/cache/man" >> "$tmpdir/manpath.config"

write_page test 1 "$tmpdir/usr/share/man/man1/test.1" UTF-8 '' '' \
	'test \- simple mandb test'
write_page test2 1 "$tmpdir/usr/dir/man/man1/test2.1" UTF-8 '' '' \
	'test2 \- simple mandb test'
run $MANDB -C "$tmpdir/manpath.config" -q "$tmpdir/usr/share/man:$tmpdir/usr/dir/man"
test -e "$tmpdir/var/cache/man/CACHEDIR.TAG"
report "CACHEDIR.TAG exists" "$?"
test ! -e "$tmpdir/usr/share/man/CACHEDIR.TAG"
report "CACHEDIR.TAG doesn't exist 01" "$?"
test ! -e "$tmpdir/usr/dir/man/CACHEDIR.TAG"
report "CACHEDIR.TAG doesn't exist 02" "$?"

finish