From: Daan De Meyer Date: Tue, 2 Jul 2024 11:36:29 +0000 (+0200) Subject: Add mirror to package cache key if one is specified X-Git-Tag: v24~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56c03b448f94ee042118592db740e3d0728d987b;p=thirdparty%2Fmkosi.git Add mirror to package cache key if one is specified On Arch Linux, pacman seems to only check if the sync db on the mirror is newer than the one available locally, which breaks when using e.g. the archive where the sync db is older by definition. Let's add any specified mirror to the default package cache dir key to make sure that a different cache is used for explicitly specified mirrors. --- diff --git a/mkosi/config.py b/mkosi/config.py index cbfd373ed..429c75544 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -1542,10 +1542,10 @@ class Config: return Path("/var/tmp") def package_cache_dir_or_default(self) -> Path: - return ( - self.package_cache_dir or - (INVOKING_USER.cache_dir() / f"{self.distribution}~{self.release}~{self.architecture}") - ) + key = f"{self.distribution}~{self.release}~{self.architecture}" + if self.mirror: + key += f"-{self.mirror}" + return self.package_cache_dir or (INVOKING_USER.cache_dir() / key) def tools(self) -> Path: return self.tools_tree or Path("/")