From: Michael Ferrari Date: Mon, 18 Nov 2024 16:48:45 +0000 (+0100) Subject: Rename some opts to be more consistent X-Git-Tag: v25~164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b4adac68a168bc12d863f1ca5fb5c69a965df9d;p=thirdparty%2Fmkosi.git Rename some opts to be more consistent --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index fec4cf2dc..4f8541364 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1230,10 +1230,10 @@ def finalize_default_initrd( "--compress-level", str(config.compress_level), "--with-network", str(config.with_network), "--cache-only", str(config.cacheonly), - *(["--output-dir", str(output_dir)] if output_dir else []), - *(["--workspace-dir", str(config.workspace_dir)] if config.workspace_dir else []), - *(["--cache-dir", str(config.cache_dir)] if config.cache_dir else []), - *(["--package-cache-dir", str(config.package_cache_dir)] if config.package_cache_dir else []), + *(["--output-directory", str(output_dir)] if output_dir else []), + *(["--workspace-directory", str(config.workspace_dir)] if config.workspace_dir else []), + *(["--cache-directory", str(config.cache_dir)] if config.cache_dir else []), + *(["--package-cache-directory", str(config.package_cache_dir)] if config.package_cache_dir else []), *(["--local-mirror", str(config.local_mirror)] if config.local_mirror else []), "--incremental", str(config.incremental), *(f"--package={package}" for package in config.initrd_packages), @@ -4163,10 +4163,10 @@ def finalize_default_tools(args: Args, config: Config, *, resources: Path) -> Co "--repository-key-check", str(config.repository_key_check), "--repository-key-fetch", str(config.repository_key_fetch), "--cache-only", str(config.cacheonly), - *(["--output-dir", str(config.output_dir)] if config.output_dir else []), - *(["--workspace-dir", str(config.workspace_dir)] if config.workspace_dir else []), - *(["--cache-dir", str(config.cache_dir)] if config.cache_dir else []), - *(["--package-cache-dir", str(config.package_cache_dir)] if config.package_cache_dir else []), + *(["--output-directory", str(config.output_dir)] if config.output_dir else []), + *(["--workspace-directory", str(config.workspace_dir)] if config.workspace_dir else []), + *(["--cache-directory", str(config.cache_dir)] if config.cache_dir else []), + *(["--package-cache-directory", str(config.package_cache_dir)] if config.package_cache_dir else []), "--incremental", str(config.incremental), *([f"--package={package}" for package in config.tools_tree_packages]), *([f"--package-directory={directory}" for directory in config.tools_tree_package_directories]), diff --git a/mkosi/config.py b/mkosi/config.py index 16d0e7288..31ae66a22 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -2350,7 +2350,7 @@ SETTINGS = ( specifier="o", parse=config_make_filename_parser( "Output= or --output= requires a filename with no path components. " - "Use OutputDirectory= or --output-dir= to configure the output directory." + "Use OutputDirectory= or --output-directory= to configure the output directory." ), default_factory=config_default_output, default_factory_depends=("image_id", "image_version"), @@ -2377,6 +2377,8 @@ SETTINGS = ( ConfigSetting( dest="output_dir", short="-O", + long="--output-directory", + compat_longs=("--output-dir",), metavar="DIR", name="OutputDirectory", section="Output", @@ -2422,7 +2424,8 @@ SETTINGS = ( ), ConfigSetting( dest="repart_dirs", - long="--repart-dir", + long="--repart-directory", + compat_longs=("--repart-dir",), metavar="PATH", name="RepartDirectories", section="Output", @@ -3225,6 +3228,8 @@ SETTINGS = ( ), ConfigSetting( dest="workspace_dir", + long="--workspace-directory", + compat_longs=("--workspace-dir",), metavar="DIR", name="WorkspaceDirectory", section="Build", @@ -3234,6 +3239,8 @@ SETTINGS = ( ), ConfigSetting( dest="cache_dir", + long="--cache-directory", + compat_longs=("--cache-dir",), metavar="PATH", name="CacheDirectory", section="Build", @@ -3244,6 +3251,8 @@ SETTINGS = ( ), ConfigSetting( dest="package_cache_dir", + long="--package-cache-directory", + compat_longs=("--package-cache-dir",), metavar="PATH", name="PackageCacheDirectory", section="Build", @@ -3253,6 +3262,8 @@ SETTINGS = ( ), ConfigSetting( dest="build_dir", + long="--build-directory", + compat_longs=("--build-dir",), metavar="PATH", name="BuildDirectory", section="Build", @@ -3532,7 +3543,8 @@ SETTINGS = ( ), ConfigSetting( dest="sysupdate_dir", - long="--sysupdate-dir", + long="--sysupdate-directory", + compat_longs=("--sysupdate-dir",), metavar="PATH", name="SysupdateDirectory", section="Host", diff --git a/mkosi/initrd.py b/mkosi/initrd.py index a06511c96..fa0476c20 100644 --- a/mkosi/initrd.py +++ b/mkosi/initrd.py @@ -101,7 +101,7 @@ def main() -> None: "--directory", "", "--format", args.format, "--output", args.output, - "--output-dir", staging_dir, + "--output-directory", staging_dir, "--extra-tree", f"/usr/lib/modules/{args.kernel_version}:/usr/lib/modules/{args.kernel_version}", "--extra-tree=/usr/lib/firmware:/usr/lib/firmware", "--remove-files=/usr/lib/firmware/*-ucode", diff --git a/mkosi/resources/man/mkosi.1.md b/mkosi/resources/man/mkosi.1.md index d79a2b76a..ca15ac695 100644 --- a/mkosi/resources/man/mkosi.1.md +++ b/mkosi/resources/man/mkosi.1.md @@ -577,7 +577,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`, : Configure the compression level to use. Takes an integer. The possible values depend on the compression being used. -`OutputDirectory=`, `--output-dir=`, `-O` +`OutputDirectory=`, `--output-directory=`, `-O` : Path to a directory where to place all generated artifacts. If this is not specified and the directory `mkosi.output/` exists in the local directory, it is automatically used for this purpose. @@ -623,7 +623,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`, root or `/usr` partition along with its Verity partition and unified kernel. By default `uki`, `kernel` and `initrd` are split out. -`RepartDirectories=`, `--repart-dir=` +`RepartDirectories=`, `--repart-directory=` : Paths to directories containing systemd-repart partition definition files that are used when mkosi invokes systemd-repart when building a disk image. If `mkosi.repart/` exists in the local directory, it will @@ -1386,7 +1386,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`, for `/etc/dnf/dnf.conf` in the sandbox trees if `dnf` is used to install packages. -`WorkspaceDirectory=`, `--workspace-dir=` +`WorkspaceDirectory=`, `--workspace-directory=` : Path to a directory where to store data required temporarily while building the image. This directory should have enough space to store the full OS image, though in most modes the actually used disk space @@ -1398,7 +1398,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`, should an `mkosi` invocation be aborted abnormally (for example, due to reboot/power failure). -`CacheDirectory=`, `--cache-dir=` +`CacheDirectory=`, `--cache-directory=` : Takes a path to a directory to use as the incremental cache directory for the incremental images produced when the `Incremental=` option is enabled. If this option is not used, but a `mkosi.cache/` directory is @@ -1410,7 +1410,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`, the distribution package manager used. If unset, a suitable directory in the user's home directory or system is used. -`BuildDirectory=`, `--build-dir=` +`BuildDirectory=`, `--build-directory=` : Takes a path to a directory to use as the build directory for build systems that support out-of-tree builds (such as Meson). The directory used this way is shared between repeated builds, and allows the build @@ -1818,7 +1818,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`, of file if your workload produces more than `4G` worth of journal data. -`SysupdateDirectory=`, `--sysupdate-dir=` +`SysupdateDirectory=`, `--sysupdate-directory=` : Path to a directory containing systemd-sysupdate transfer definition files that are used by `mkosi sysupdate`. If `mkosi.sysupdate/` exists in the local directory, it will be used for this purpose as @@ -2627,8 +2627,8 @@ project. re-building of images. Specifically: 1. The package cache of the distribution package manager may be cached - between builds. This is configured with the `--cache-dir=` option or - the `mkosi.cache/` directory. This form of caching relies on the + between builds. This is configured with the `--cache-directory=` option + or the `mkosi.cache/` directory. This form of caching relies on the distribution's package manager, and caches distribution packages (RPM, DEB, …) after they are downloaded, but before they are unpacked. diff --git a/tests/__init__.py b/tests/__init__.py index 302511604..5840b4ad3 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -103,7 +103,7 @@ class Image: *(f"--kernel-command-line={i}" for i in kcl), "--force", "--incremental", - "--output-dir", self.output_dir, + "--output-directory", self.output_dir, *(["--debug-shell"] if self.config.debug_shell else []), *options, ] # fmt: skip diff --git a/tests/test_initrd.py b/tests/test_initrd.py index 5b730284f..0a2784c26 100644 --- a/tests/test_initrd.py +++ b/tests/test_initrd.py @@ -150,7 +150,7 @@ def test_initrd_luks(config: ImageConfig, passphrase: Path) -> None: ) with Image(config) as image: - image.build(["--repart-dir", repartd, "--passphrase", passphrase, "--format=disk"]) + image.build(["--repart-directory", repartd, "--passphrase", passphrase, "--format=disk"]) image.qemu(["--credential=cryptsetup.passphrase=mkosi"])