Skip to content

Commit

Permalink
Put .profile section values in quotes if not alphanumeric
Browse files Browse the repository at this point in the history
This is supposed to be sourcable by shells so make sure we use
quotes in case values with whitespace are used.
  • Loading branch information
DaanDeMeyer committed Oct 7, 2024
1 parent f1f86c1 commit 2a35f99
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mkosi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'"):
Expand Down

0 comments on commit 2a35f99

Please sign in to comment.