From: Daan De Meyer Date: Mon, 18 Nov 2024 20:06:17 +0000 (+0100) Subject: Also fail early if default tools tree is out of date without --force X-Git-Tag: v25~163^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=577f328ca6bc7622a4f6ac108eadcac97173b731;p=thirdparty%2Fmkosi.git Also fail early if default tools tree is out of date without --force We fail early if the tools tree does not exist and build or --force was not specified, let's do the same if the tools tree is incremental and the cache is out-of-date. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 565c2b85a..55ace22d4 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -4647,13 +4647,17 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None: if ( tools - and not (tools.output_dir_or_cwd() / tools.output).exists() + and ( + not (tools.output_dir_or_cwd() / tools.output).exists() + or (tools.incremental and not have_cache(tools)) + ) and args.verb != Verb.build and not args.force ): die( - f"Default tools tree requested for image '{last.name()}' but it has not been built yet", - hint="Make sure to build the image first with 'mkosi build' or use '--force'", + f"Default tools tree requested for image '{last.name()}' but it is out-of-date or has not been " + "built yet", + hint="Make sure to (re)build the image first with 'mkosi build' or use '--force'", ) if not last.repart_offline and os.getuid() != 0: