index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2022-08-12 22:36:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 22:36:06 +0200 |
commit | b1ab5ba3723ef0d7c04b061189d5ad74cba0de8b (patch) | |
tree | 9cc76786781b1c6db23d5f439d02a7e732f3c434 /archinstall/lib | |
parent | 7b4940ef6d2ec7631e948cffe55518e75609dcf3 (diff) |
-rw-r--r-- | archinstall/lib/general.py | 2 | ||||
-rw-r--r-- | archinstall/lib/installer.py | 21 |
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 9edbaea8..1dc37994 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -444,7 +444,7 @@ class SysCommand: def __repr__(self, *args :List[Any], **kwargs :Dict[str, Any]) -> str: if self.session: - return self.session._trace_log.decode('UTF-8') + return self.session._trace_log.decode('UTF-8', errors='backslashreplace') return '' def __json__(self) -> Dict[str, Union[str, bool, List[str], Dict[str, Any], Optional[bool], Optional[Dict[str, Any]]]]: diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 62257642..08896289 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -443,10 +443,27 @@ class Installer: if not len(locale): return True + modifier = '' + + # This is a temporary patch to fix #1200 + if '.' in locale: + locale, potential_encoding = locale.split('.', 1) + + # Override encoding if encoding is set to the default parameter + # and the "found" encoding differs. + if encoding == 'UTF-8' and encoding != potential_encoding: + encoding = potential_encoding + + # Make sure we extract the modifier, that way we can put it in if needed. + if '@' in locale: + locale, modifier = locale.split('@', 1) + modifier = f"@{modifier}" + # - End patch + with open(f'{self.target}/etc/locale.gen', 'a') as fh: - fh.write(f'{locale}.{encoding} {encoding}\n') + fh.write(f'{locale}.{encoding}{modifier} {encoding}\n') with open(f'{self.target}/etc/locale.conf', 'w') as fh: - fh.write(f'LANG={locale}.{encoding}\n') + fh.write(f'LANG={locale}.{encoding}{modifier}\n') return True if SysCommand(f'/usr/bin/arch-chroot {self.target} locale-gen').exit_code == 0 else False |