File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -4726,6 +4726,10 @@ def sync_repository_metadata(
47264726 for d in ("cache" , "lib" ):
47274727 (metadata_dir / d / subdir ).mkdir (parents = True , exist_ok = True )
47284728
4729+ src = metadata_dir / "lib" / subdir
4730+ for p in last .distribution .installer .package_manager (last ).state_subdirs ():
4731+ (src / p ).mkdir (parents = True , exist_ok = True )
4732+
47294733 (last .package_cache_dir_or_default () / "cache" / subdir ).mkdir (parents = True , exist_ok = True )
47304734
47314735 # Sync repository metadata unless explicitly disabled.
@@ -4753,7 +4757,6 @@ def sync_repository_metadata(
47534757 context ,
47544758 force = context .args .force > 1 or context .config .cacheonly == Cacheonly .never ,
47554759 )
4756-
47574760 src = metadata_dir / "cache" / subdir
47584761 dst = last .package_cache_dir_or_default () / "cache" / subdir
47594762
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def package_globs(cls) -> list[str]:
3030 return []
3131
3232 @classmethod
33- def state_subdirs (cls , state : Path ) -> list [Path ]:
33+ def state_subdirs (cls ) -> list [Path ]:
3434 return []
3535
3636 @classmethod
@@ -85,7 +85,12 @@ def mounts(cls, context: Context) -> list[PathString]:
8585 subdir = context .config .distribution .installer .package_manager (context .config ).subdir (context .config )
8686
8787 src = context .metadata_dir / "lib" / subdir
88- mounts += ["--bind" , src , Path ("/var/lib" ) / subdir ]
88+ mounts += flatten (
89+ ("--bind" , src / state_subdir , Path ("/var/lib" ) / subdir / state_subdir )
90+ for state_subdir in context .config .distribution .installer .package_manager (
91+ context .config
92+ ).state_subdirs ()
93+ )
8994
9095 src = context .metadata_dir / "cache" / subdir
9196 caches = context .config .distribution .installer .package_manager (context .config ).package_subdirs (src )
Original file line number Diff line number Diff line change @@ -64,8 +64,8 @@ def package_globs(cls) -> list[str]:
6464 return ["*.deb" , "*.ddeb" ]
6565
6666 @classmethod
67- def state_subdirs (cls , state : Path ) -> list [Path ]:
68- return [state / "lists" ]
67+ def state_subdirs (cls ) -> list [Path ]:
68+ return [Path ( "lists" ) ]
6969
7070 @classmethod
7171 def dpkg_cmd (cls , command : str ) -> list [PathString ]:
Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ def package_globs(cls) -> list[str]:
4343 return ["*.pkg.tar*" ]
4444
4545 @classmethod
46- def state_subdirs (cls , state : Path ) -> list [Path ]:
47- return [state / "sync" ]
46+ def state_subdirs (cls ) -> list [Path ]:
47+ return [Path ( "sync" ) ]
4848
4949 @classmethod
5050 def scripts (cls , context : Context ) -> dict [str , list [PathString ]]:
You can’t perform that action at this time.
0 commit comments