From: Daan De Meyer Date: Fri, 13 Feb 2026 08:01:03 +0000 (+0100) Subject: config: Make sure we handle empty lists from history properly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5842befe340badb79e5a383d1790cb3c1a7bae0;p=thirdparty%2Fmkosi.git config: Make sure we handle empty lists from history properly If we get an empty list from the history, that means the empty string was specified on the cli, and hence we should treat it as a reset (by setting the xxx_was_none field in the dict same as we would when parsing it from the cli). Note that we only need to do this for list based settings as regular values will just have their default value written into the history. --- diff --git a/mkosi/config.py b/mkosi/config.py index f8cef3c87..fbcc799e8 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -5371,6 +5371,9 @@ def parse_config( f"Ignoring {s.long} from the CLI. Run with -f to rebuild the image with this setting" ) + if s.dest in history and isinstance(history[s.dest], (list, dict, set)) and not history[s.dest]: + history[f"{s.dest}_was_none"] = True + context.cli |= history cli = copy.deepcopy(context.cli)