89luca89 / 89luca89/distrobox

[Error] HOST_LOCALE not obtained correctly when /etc/locale.conf doesn't exist

未關閉
#1,840 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Go
星號
13k
分支
541
平均合併
20 小時 47 分鐘
30 天內合併 PR
4

描述

**Describe the bug**
Currently, when creating a distrobox on a host system where /etc/locale.conf does not exist, the container's LANG variable will be set to a locale that's not available in the container.

For example, in gentoo, the locale is set in [/etc/env.d/02locale](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Locale_selection) instead of /etc/locale.conf, which the distrobox-init script never reads, and instead initializes the HOST_LOCALE variable to a fallback value.

I'd suggest having distrobox pick up the LANG variable from the host environment, instead of trying to parse host system configuration. Alternatively, distrobox should provide a way to set HOST_LOCALE in the configuration, and set the container's LANG variable to the same value.

This is a follow-up of https://github.com/89luca89/distrobox/issues/1743

貢獻指南

開啟貢獻指南

研究方向

查看設定 HOST_LOCALE 的 distrobox-init 指令碼,可能位於 /usr/local/bin/distrobox-init 或類似位置。該指令碼目前讀取 /etc/locale.conf;修改它,使其同時檢查主機的 LANG 環境變數,或在 Gentoo 上讀取 /etc/env.d/02locale。透過在 Gentoo 主機或沒有 /etc/locale.conf 的系統上建立容器進行測試,並驗證容器的 LANG 與主機的 locale 相符。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
bash, shell
領域
cli, developer-experience
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
65/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。