From 1fd37912d2d72800e3dedae8178e15f2b3c42606 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rg=20Behrmann?= Date: Wed, 24 Sep 2025 12:07:00 +0200 Subject: [PATCH] util: widen allowed characters in read_env_file Currently we only read uppercase variables starting with a letter, but shell variables only restriction is not starting with a number, so lowercase names and names starting with an underscore are allowed. --- mkosi/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi/util.py b/mkosi/util.py index 212dd8f55..53e0a08eb 100644 --- a/mkosi/util.py +++ b/mkosi/util.py @@ -83,7 +83,7 @@ def read_env_file(path: PathString) -> Iterator[tuple[str, str]]: line = line.rstrip() if not line or line.startswith("#"): continue - if m := re.match(r"([A-Z][A-Z_0-9]+)=(.*)", line): + if m := re.match(r"([a-zA-Z_][a-zA-Z_0-9]+)=(.*)", line): name, val = m.groups() if val and val[0] in "\"'": val = ast.literal_eval(val) -- 2.47.3