also set LC_ALL

This commit is contained in:
JerryXiao 2024-01-22 23:38:01 +08:00
parent 5e7e69f0d8
commit d613ffe37c
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5

View file

@ -258,14 +258,17 @@ def main() -> None:
) )
locales = [l.lower() for l in p.stdout.strip().split('\n')] locales = [l.lower() for l in p.stdout.strip().split('\n')]
preferred = ['en_US.UTF-8', 'C.UTF-8'] preferred = ['en_US.UTF-8', 'C.UTF-8']
env_vars = ['LANG', 'LC_ALL']
for l in preferred: for l in preferred:
if l.lower() in locales: if l.lower() in locales:
logger.debug(f'using locale {l}') logger.debug(f'using locale {l}')
environ['LANG'] = l for env_var in env_vars:
environ[env_var] = l
break break
else: else:
logger.debug('using fallback locale C') logger.debug('using fallback locale C')
environ['LANG'] = 'C' for env_var in env_vars:
environ[env_var] = 'C'
def clear_pkg_cache() -> None: def clear_pkg_cache() -> None:
logger.debug('clearing package cache') logger.debug('clearing package cache')
for i in Path(PACMAN_PKG_DIR).iterdir(): for i in Path(PACMAN_PKG_DIR).iterdir():