From: Daan De Meyer Date: Sun, 3 Nov 2024 19:18:39 +0000 (+0100) Subject: Remove sandbox verb from needs_build() X-Git-Tag: v25~186^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cc8c6f5e9363813eb2c8f2160ffe0e529a8f40c;p=thirdparty%2Fmkosi.git Remove sandbox verb from needs_build() It's not a clear cut case whether the sandbox needs a build or not. The needs_build() method was originally intended for verbs that need a full image build but the sandbox build only needs the tools tree. Also, the tools tree is only built if ToolsTree=default and not if set explicitly. More practically, we don't want the JSON history from .mkosi-private to be used when using mkosi sandbox, and that's the only usage of the needs_build() method, so to fix that problem let's remove the sandbox verb from needs_build(). --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index dfc59d27d..afcc21b00 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -4596,7 +4596,7 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None: return - assert args.verb.needs_build() + assert args.verb == Verb.sandbox or args.verb.needs_build() if ( tools diff --git a/mkosi/config.py b/mkosi/config.py index 75bdb1401..0d09ce2da 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -104,7 +104,6 @@ class Verb(StrEnum): Verb.serve, Verb.burn, Verb.sysupdate, - Verb.sandbox, ) def needs_config(self) -> bool: