From c1981400e0e26ad5a38645c056434c71b01d948d Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 22 Jan 2025 12:15:42 +0100 Subject: [PATCH] Special case tools image in keyring_cache() and metadata_cache() Similar to cache_tree_paths(), give the metadata and keyring cache for the default tools tree a custom name to avoid conflicts with the other image caches. --- mkosi/__init__.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 6d1ea1f1f..1233b4403 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2472,17 +2472,23 @@ def cache_tree_paths(config: Config) -> tuple[Path, Path, Path]: def keyring_cache(config: Config) -> Path: - assert config.cache_dir - fragments = [config.distribution, config.release, config.architecture] + if config.image == "tools": + key = "tools" + else: + key = f"{'~'.join(str(s) for s in (config.distribution, config.release, config.architecture))}" - return config.cache_dir / f"{'~'.join(str(s) for s in fragments)}.keyring.cache" + assert config.cache_dir + return config.cache_dir / f"{key}.keyring.cache" def metadata_cache(config: Config) -> Path: - assert config.cache_dir - fragments = [config.distribution, config.release, config.architecture] + if config.image == "tools": + key = "tools" + else: + key = f"{'~'.join(str(s) for s in (config.distribution, config.release, config.architecture))}" - return config.cache_dir / f"{'~'.join(str(s) for s in fragments)}.metadata.cache" + assert config.cache_dir + return config.cache_dir / f"{key}.metadata.cache" def check_inputs(config: Config) -> None: -- 2.47.3