From: Daan De Meyer Date: Fri, 12 Sep 2025 07:40:55 +0000 (+0200) Subject: Always use repository metadata from /var package cache directory X-Git-Tag: v26~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56cdbc25b50c457d0d1e8cd6d8c2cce8feb6511d;p=thirdparty%2Fmkosi.git Always use repository metadata from /var package cache directory Fixes #3883 --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 30f8854b3..0dc7cb8d3 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -4893,7 +4893,12 @@ def sync_repository_metadata( # same cache directory as they both only use the repository id as the cache key which will trivially # conflict across multiple mirrors. Apt and Fedora put the mirror in the cache key for the repository # metadata in some form which avoids conflicts across different mirrors. - shared_repository_metadata_cache = last.distribution.package_manager(last) not in (Pacman, Zypper) + # + # If /var is used as the package cache directory, we are reusing the system package cache directory in + # mkosi-initrd so we *do* want to pick up the metadata from there in that case. + shared_repository_metadata_cache = last.package_cache_dir_or_default() == Path( + "/var" + ) or last.distribution.package_manager(last) not in (Pacman, Zypper) if shared_repository_metadata_cache: dst = last.package_cache_dir_or_default()