From: Daan De Meyer Date: Mon, 7 Oct 2024 10:38:12 +0000 (+0200) Subject: Put .profile section values in quotes if not alphanumeric X-Git-Tag: v25~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a35f9958bc6b82d95d1eac02dc245e9bb068765;p=thirdparty%2Fmkosi.git Put .profile section values in quotes if not alphanumeric This is supposed to be sourcable by shells so make sure we use quotes in case values with whitespace are used. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 7436a1eda..28bc11845 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2011,6 +2011,9 @@ def build_uki_profiles(context: Context, cmdline: Sequence[str]) -> list[Path]: with profile_section.open("w") as f: for k, v in profile.profile.items(): + if not all(c.isalnum() for c in v): + v = f'"{v}"' + f.write(f"{k}={v}\n") with complete_step(f"Generating UKI profile '{id}'"):