prepend_to_environ_path,
)
-MKOSI_COMMANDS_NEED_BUILD = (Verb.shell, Verb.boot, Verb.qemu, Verb.serve)
+MKOSI_COMMANDS_NEED_BUILD = (Verb.build, Verb.shell, Verb.boot, Verb.qemu, Verb.serve)
MKOSI_COMMANDS_SUDO = (Verb.shell, Verb.boot)
def needs_build(args: MkosiArgs, config: MkosiConfig) -> bool:
- if args.verb == Verb.build:
- return True
-
return args.verb in MKOSI_COMMANDS_NEED_BUILD and (args.force > 0 or not config.output_dir.joinpath(config.output_with_compression).exists())
if last.compress_output:
die(f"Sorry, can't {opname} a compressed image.")
+ for config in presets:
+ check_inputs(config)
+
+ if args.verb == Verb.build and not args.force:
+ check_outputs(config)
+
# First, process all directory removals because otherwise if different presets share directories a later
# preset could end up output generated by an earlier preset.
if not needs_build(args, config):
continue
- check_inputs(config)
-
- if not args.force:
- check_outputs(config)
-
with prepend_to_environ_path(config.extra_search_paths):
def target() -> None:
# Get the user UID/GID either on the host or in the user namespace running the build