Skip to content

Commit 289aba4

Browse files
committed
Set LANG to fully qualified locale name
1 parent b0bfb43 commit 289aba4

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

archinstall/lib/installer.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -660,16 +660,12 @@ def set_locale(self, locale_config: LocaleConfiguration) -> bool:
660660
# in the first column of the entry; check for both cases.
661661
entry_re = re.compile(rf'#{lang}(\.{encoding})?{modifier} {encoding}')
662662

663-
lang_value = None
664663
for index, line in enumerate(locale_gen_lines):
665664
if entry_re.match(line):
666-
uncommented_line = line.removeprefix('#')
667-
locale_gen_lines[index] = uncommented_line
665+
locale_gen_lines[index] = line.removeprefix('#')
668666
locale_gen.write_text(''.join(locale_gen_lines))
669-
lang_value = uncommented_line.split()[0]
670667
break
671-
672-
if lang_value is None:
668+
else:
673669
error(f"Invalid locale: language '{locale_config.sys_lang}', encoding '{locale_config.sys_enc}'")
674670
return False
675671

@@ -679,7 +675,7 @@ def set_locale(self, locale_config: LocaleConfiguration) -> bool:
679675
error(f'Failed to run locale-gen on target: {e}')
680676
return False
681677

682-
(self.target / 'etc/locale.conf').write_text(f'LANG={lang_value}\n')
678+
(self.target / 'etc/locale.conf').write_text(f'LANG={lang}.{encoding}{modifier}\n')
683679
return True
684680

685681
def set_timezone(self, zone: str) -> bool:

0 commit comments

Comments
 (0)