args.force becomes an integer which behaves the same as a bool.
args.force_count is removed and every usage of force_count is
replaced by force.
"-f",
"--force",
action="count",
- dest="force_count",
+ dest="force",
default=0,
help="Remove existing image file before operation",
)
# additional "--force".
if args.verb == "clean":
- remove_build_cache = args.force_count > 0
- remove_package_cache = args.force_count > 1
+ remove_build_cache = args.force > 0
+ remove_package_cache = args.force > 1
else:
- remove_build_cache = args.force_count > 1
- remove_package_cache = args.force_count > 2
+ remove_build_cache = args.force > 1
+ remove_package_cache = args.force > 2
if remove_build_cache:
if args.cache_pre_dev is not None or args.cache_pre_inst is not None:
if args.cmdline and args.verb not in MKOSI_COMMANDS_CMDLINE:
die("Additional parameters only accepted for " + str(MKOSI_COMMANDS_CMDLINE)[1:-1] + " invocations.")
- args.force = args.force_count > 0
-
if args.output_format is None:
args.output_format = OutputFormat.gpt_ext4
if not args.incremental:
return False
- if args.force_count > 1:
+ if args.force > 1:
return True
assert args.cache_pre_dev
manifest_format: List[ManifestFormat]
output: Path
output_dir: Optional[Path]
- force_count: int
bootable: bool
boot_protocols: List[str]
kernel_command_line: List[str]
verity_size: Optional[int]
verity_sig_size: Optional[int]
machine_id: str
- force: bool
+ force: int
original_umask: int
passphrase: Optional[Dict[str, str]]
"extra_search_paths": [],
"extra_trees": [],
"finalize_script": None,
- "force_count": 0,
+ "force": 0,
"gpt_first_lba": None,
"home_size": None,
"hostname": None,
if "Output" in mk_config_output:
self.reference_config[job_name]["output"] = Path(mk_config_output["Output"])
if "Force" in mk_config_output:
- self.reference_config[job_name]["force_count"] += 1
+ self.reference_config[job_name]["force"] += 1
if "Bootable" in mk_config_output:
self.reference_config[job_name]["bootable"] = mk_config_output["Bootable"]
if "BootProtocols" in mk_config_output:
ref_c["distribution"] = "arch"
ref_c["release"] = "7"
self._append_list("repositories", "centos/repos", j)
- ref_c["force_count"] += 1
+ ref_c["force"] += 1
ref_c["read_only"] = False
ref_c["incremental"] = True