From: Jörg Behrmann Date: Wed, 24 Sep 2025 10:07:00 +0000 (+0200) Subject: util: widen allowed characters in read_env_file X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3914%2Fhead;p=thirdparty%2Fmkosi.git 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. --- 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)