]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Only run sync scripts if we're going to build the image
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 29 Aug 2024 15:59:21 +0000 (17:59 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 30 Aug 2024 08:25:02 +0000 (10:25 +0200)
mkosi/__init__.py

index cc8482c43db5686fad6af5957f7c259b9a736d8a..8dffb6584f6e05c0f3dce4b6886e7fb9ecc89121 100644 (file)
@@ -4829,7 +4829,6 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
         with prepend_to_environ_path(config):
             check_tools(config, args.verb)
             images[i] = config = run_configure_scripts(config)
-            run_sync_scripts(config)
 
     # The images array has been modified so we need to reevaluate last again.
     last = images[-1]
@@ -4842,6 +4841,9 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
             run_sync(args, last, resources=resources)
             copy_repository_metadata(last, Path(metadata_dir))
 
+            for config in images:
+                run_sync_scripts(config)
+
             for config in images:
                 # 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: