]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Rename cache_subdirs() to package_subdirs()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 16 Apr 2025 07:35:41 +0000 (09:35 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 16 Apr 2025 08:34:04 +0000 (10:34 +0200)
This method returns subdirs of the cache dir that contain packages
so package_subdirs() seems like a more approriate name.

mkosi/__init__.py
mkosi/installer/__init__.py
mkosi/installer/apt.py
mkosi/installer/dnf.py
mkosi/installer/pacman.py
mkosi/installer/zypper.py

index c282d3d5051aa530bfd13504a01a5beeea3d1eb6..5eda5fec10b156eab2fa6be58bf4fff9a0398269 100644 (file)
@@ -3884,7 +3884,7 @@ def copy_repository_metadata(config: Config, dst: Path) -> None:
                 if d == "cache":
                     exclude = flatten(
                         ("--ro-bind", tmp, workdir(p))
-                        for p in config.distribution.package_manager(config).cache_subdirs(src)
+                        for p in config.distribution.package_manager(config).package_subdirs(src)
                     )
                 else:
                     exclude = flatten(
@@ -4853,7 +4853,7 @@ def sync_repository_metadata(
                 )
 
     src = last.package_cache_dir_or_default() / "cache" / subdir
-    for p in last.distribution.package_manager(last).cache_subdirs(src):
+    for p in last.distribution.package_manager(last).package_subdirs(src):
         p.mkdir(parents=True, exist_ok=True)
 
     # If we're in incremental mode and caching metadata is not explicitly disabled, cache the keyring and the
index 5a49da680cc0f68814dcf6542d569e406a96dee9..fa7418ae09a65d3531ce3a85c372cf7a389db7db 100644 (file)
@@ -22,7 +22,7 @@ class PackageManager:
         return Path("custom")
 
     @classmethod
-    def cache_subdirs(cls, cache: Path) -> list[Path]:
+    def package_subdirs(cls, cache: Path) -> list[Path]:
         return []
 
     @classmethod
@@ -85,7 +85,7 @@ class PackageManager:
             # configured package cache directory in this scenario, we mount in the relevant directories from
             # the configured package cache directory.
             if d == "cache" and context.metadata_dir != context.config.package_cache_dir_or_default():
-                caches = context.config.distribution.package_manager(context.config).cache_subdirs(src)
+                caches = context.config.distribution.package_manager(context.config).package_subdirs(src)
                 mounts += flatten(
                     (
                         "--bind",
index becb6d38e648bf8be5ef47669f757f52f2f0fd62..4750f714516c4966144d4cf333e930948e6f0b88 100644 (file)
@@ -54,7 +54,7 @@ class Apt(PackageManager):
         return Path("apt")
 
     @classmethod
-    def cache_subdirs(cls, cache: Path) -> list[Path]:
+    def package_subdirs(cls, cache: Path) -> list[Path]:
         return [cache / "archives"]
 
     @classmethod
index dec412932a559f3a7cc190fd6a0c6bb200252060..ea42882837eb6fc3ee34b0cd93473e522ab1e129 100644 (file)
@@ -25,7 +25,7 @@ class Dnf(PackageManager):
         return Path("libdnf5" if cls.executable(config) == "dnf5" else "dnf")
 
     @classmethod
-    def cache_subdirs(cls, cache: Path) -> list[Path]:
+    def package_subdirs(cls, cache: Path) -> list[Path]:
         return [
             p / "packages" for p in cache.iterdir() if p.is_dir() and "-" in p.name and "mkosi" not in p.name
         ]
index 08d8e0f56b6face74682067c76dcb18cb8acccb6..cc86de294b4930bc55754a47b19ade304cfd0cfa 100644 (file)
@@ -35,7 +35,7 @@ class Pacman(PackageManager):
         return Path("pacman")
 
     @classmethod
-    def cache_subdirs(cls, cache: Path) -> list[Path]:
+    def package_subdirs(cls, cache: Path) -> list[Path]:
         return [cache / "pkg"]
 
     @classmethod
index f36c8af35d6d3fc5db2c77751cff7e30edf56255..0f6c689be88f5f0a5520ea491b758ab4e0f37c2f 100644 (file)
@@ -23,7 +23,7 @@ class Zypper(PackageManager):
         return Path("zypp")
 
     @classmethod
-    def cache_subdirs(cls, cache: Path) -> list[Path]:
+    def package_subdirs(cls, cache: Path) -> list[Path]:
         return [cache / "packages"]
 
     @classmethod