mandoc does not handle locale properly when /usr/share/man/mandoc.db exists
Environment:
- Alpine 3.13
- mandoc-apropos is installed, so a
makewhatis -a ...
is triggered every time something is added/removed under /usr/share/man.
How to trigger:
- install a *-doc package which has multilingual man pages, I'll use
lxc-doc
for example below
Results:
# pwd
/usr/share/man
# echo $LANG $LC_ALL
# ls -l
total 1545
drwxr-xr-x 2 root root 84 Jan 6 01:18 man0
drwxr-xr-x 2 root root 284 Jan 16 00:57 man1
drwxr-xr-x 2 root root 493 Jan 6 01:18 man2
drwxr-xr-x 2 root root 2593 Jan 16 00:04 man3
drwxr-xr-x 2 root root 42 Jan 6 01:18 man4
drwxr-xr-x 2 root root 74 Jan 16 00:57 man5
drwxr-xr-x 2 root root 3 Jan 6 01:18 man6
drwxr-xr-x 2 root root 175 Jan 16 00:57 man7
drwxr-xr-x 2 root root 311 Jan 16 00:57 man8
-rw-r--r-- 1 root root 430888 Jan 16 00:58 mandoc.db
# apk add lxc-doc
(1/1) Installing lxc-doc (4.0.6-r1)
Executing mandoc-apropos-1.14.5-r5.trigger
OK: 1240 MiB in 388 packages
# ls -l
total 1310
drwxr-xr-x 6 root root 6 Jan 16 00:58 ja
drwxr-xr-x 5 root root 5 Jan 16 00:58 ko
drwxr-xr-x 2 root root 84 Jan 6 01:18 man0
drwxr-xr-x 2 root root 310 Jan 16 00:58 man1
drwxr-xr-x 2 root root 493 Jan 6 01:18 man2
drwxr-xr-x 2 root root 2593 Jan 16 00:04 man3
drwxr-xr-x 2 root root 42 Jan 6 01:18 man4
drwxr-xr-x 2 root root 78 Jan 16 00:58 man5
drwxr-xr-x 2 root root 3 Jan 6 01:18 man6
drwxr-xr-x 2 root root 176 Jan 16 00:58 man7
drwxr-xr-x 2 root root 312 Jan 16 00:58 man8
-rw-r--r-- 1 root root 440840 Jan 16 00:58 mandoc.db
# man lxc-start | head -20
lxc-start(1) lxc-start(1)
NAME
lxc-start - コンテナ内でのアプリケーションの実行
SYNOPSIS
lxc-start
{-n name} [-f config_file] [-c console_device] [-L console_logfile] [-d] [-F]
[-p pid_file] [-s KEY=VAL] [-C] [--share-[net|ipc|uts] name|pid] [command]
説 明
lxc-start は command で指定されたコマンドを、name
で指定されたコンテナ内で実行します。
このコマンドは、lxc-create
コマンドもしくは設定ファイルのパラメータであらかじめ定義された設定に従ってコンテナをセットアップします。
もし設定が定義されていない場合は、デフォルトの隔離状態を使用します。
# rm mandoc.db
# man lxc-start | head -20
lxc-start(1) lxc-start(1)
NAME
lxc-start - run an application inside a container.
SYNOPSIS
lxc-start
{-n name} [-f config_file] [-c console_device] [-L console_logfile] [-d] [-F]
[-p pid_file] [-s KEY=VAL] [-C] [--share-[net|ipc|uts] name|pid] [command]
DESCRIPTION
lxc-start runs the specified command inside the container specified by
name.
It will setup the container according to the configuration previously
defined with the lxc-create command or with the configuration file
parameter. If no configuration is defined, the default isolation is
used.
#
The behaviour is the same when I set LANG
and LC_ALL
to either C
or en_US.UTF-8
.