0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

portsのmake configで表示が化ける場合の対処方法

Posted at

ports の make configで表示が化ける

14.0R あたりからなのですが、ports のビルド時にデフォルトのオプションから変更したい場合に make configで設定を変更しようとすると locale またはターミナルの環境によっては表示されるダイアログの表示が化けてしまう場合がある様です。

こんな感じ

ports_net_rsync_NG.png

原因

この原因ですが、/usr/ports/Mk/Script/以下にある dialog4ports.sh と思われます。

dialog4ports.sh から抜粋
# Backwards compat with older version which used stdout [<= 0.1.1] (or stderr [0.1.2]).
# Clear environment of PKGNAME or the dialog will show on older versions
# that do not understand -v.
if ! env -u PKGNAME ${DIALOG4PORTS} -v > /dev/null 2>&1; then
	exec env LC_ALL=C.UTF-8 $DIALOG4PORTS > $OPTIONSFILE 2>&1
fi

# Newer versions use stderr to work around a jail issue
# http://lists.freebsd.org/pipermail/freebsd-ports/2013-March/082383.html
exec env LC_ALL=C.UTF-8 $DIALOG4PORTS 2> $OPTIONSFILE

DIALOG4PORTS を呼び出す際に環境変数 LC _ALL を強制的に UTF-8 に設定しているのが原因の様なので, LC_ALL=C .UTF-8 を LC_ALL=C に変更すると以下の様に正常に表示される様になります。

対処後

ports_net_rsync_OK.png

おまけ

git log で dialog4ports.sh の 変更履歴を見るとこんな記述が...

Date:   Wed Oct 11 09:54:12 2023 +0200

    dialog: force UTF-8 locale

    On some terminal, namely "putty" and "linux", the unicode capability
    are not properly exposed, resulting in a not so nice UI, forcing
    the env to be unicode friendly with executing the DIDALOG commnands
    make the output nice in those environements

一部のターミナルで不具合があるので対処したとの事ですが、全てのユーザ環境に対応するのは中々難しいのかもしれません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?