Skip to content

Commit f38fd89

Browse files
committed
general: rework environment_vars
1 parent 05441a4 commit f38fd89

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

archinstall/lib/general.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,12 @@ def __init__(
107107
cmd: str | list[str],
108108
callbacks: dict[str, Any] | None = None,
109109
peek_output: bool | None = False,
110-
environment_vars: dict[str, Any] | None = None,
110+
environment_vars: dict[str, str] | None = None,
111111
logfile: None = None,
112112
working_directory: str | None = './',
113113
remove_vt100_escape_codes_from_lines: bool = True
114114
):
115115
callbacks = callbacks or {}
116-
environment_vars = environment_vars or {}
117116

118117
if isinstance(cmd, str):
119118
cmd = shlex.split(cmd)
@@ -126,7 +125,10 @@ def __init__(
126125
self.callbacks = callbacks
127126
self.peek_output = peek_output
128127
# define the standard locale for command outputs. For now the C ascii one. Can be overridden
129-
self.environment_vars = {**storage.get('CMD_LOCALE', {}), **environment_vars}
128+
self.environment_vars = {'LC_ALL': 'C'}
129+
if environment_vars:
130+
self.environment_vars.update(environment_vars)
131+
130132
self.logfile = logfile
131133
self.working_directory = working_directory
132134

@@ -353,7 +355,7 @@ def __init__(
353355
callbacks: dict[str, Callable[[Any], Any]] = {},
354356
start_callback: Callable[[Any], Any] | None = None,
355357
peek_output: bool | None = False,
356-
environment_vars: dict[str, Any] | None = None,
358+
environment_vars: dict[str, str] | None = None,
357359
working_directory: str | None = './',
358360
remove_vt100_escape_codes_from_lines: bool = True):
359361

archinstall/lib/luks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def _add_key(self, key_file: Path) -> None:
208208
debug(f'Adding additional key-file {key_file}')
209209

210210
command = f'/usr/bin/cryptsetup -q -v luksAddKey {self.luks_dev_path} {key_file}'
211-
worker = SysCommandWorker(command, environment_vars={'LC_ALL': 'C'})
211+
worker = SysCommandWorker(command)
212212
pw_injected = False
213213

214214
while worker.is_alive():

archinstall/lib/storage.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@
1414
'LOG_FILE': Path('install.log'),
1515
'MOUNT_POINT': Path('/mnt/archinstall'),
1616
'ENC_IDENTIFIER': 'ainst',
17-
'CMD_LOCALE': {'LC_ALL': 'C'}, # default locale for execution commands. Can be overridden with set_cmd_locale()
18-
'CMD_LOCALE_DEFAULT': {'LC_ALL': 'C'}, # should be the same as the former. Not be used except in reset_cmd_locale()
1917
}

0 commit comments

Comments
 (0)