89luca89 / 89luca89/distrobox

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

Aberta
#1,840 0 comentários 1 reação 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Go
Estrelas
13k
Forks
541
Merge médio
20h 47min
PRs com merge (30d)
4

Descrição

**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

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Verifique o script distrobox-init onde HOST_LOCALE é definido, provavelmente em /usr/local/bin/distrobox-init ou em um local semelhante. Atualmente, o script lê /etc/locale.conf; modifique-o para também verificar a variável de ambiente LANG do host ou ler /etc/env.d/02locale no Gentoo. Teste criando um container em um host Gentoo ou em um sistema sem /etc/locale.conf e verifique se o LANG do container corresponde ao locale do host.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
bash, shell
Domínio
cli, developer-experience
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
65/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.