]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Exit early if output format is none and there are no build scripts
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 2 Aug 2024 11:16:17 +0000 (13:16 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 2 Aug 2024 14:29:53 +0000 (16:29 +0200)
In systemd, the build script is part of a subimage so the build is
done as part of the subimage and there's nothing to do for the main
image. To speed things up a bit, exit early if there are no build
scripts and the output format is none.

mkosi/__init__.py

index 186af45758e40fac32aa9699e4a74f72a204f25e..3530c36c367b6a3f1b7a01d8efd86e88c60da329 100644 (file)
@@ -4929,6 +4929,10 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
             ):
                 continue
 
+            # If the output format is "none" and there are no build scripts, there's nothing to do so exit early.
+            if config.output_format == OutputFormat.none and not config.build_scripts:
+                return
+
             check_inputs(config)
             fork_and_wait(run_sync, args, config, resources=resources)
             fork_and_wait(run_build, args, config, resources=resources, package_dir=Path(package_dir))