@@ -41,7 +41,19 @@ def package_manager(cls, config: Config) -> type[Apt]:
4141 @classmethod
4242 def repositories (cls , context : Context , for_image : bool = False ) -> Iterable [AptRepository ]:
4343 types = ("deb" , "deb-src" )
44- components = ("main" , * context .config .repositories )
44+ components = ("main" , * [s for s in context .config .repositories if ":" not in s ])
45+ suite_components = {}
46+ for s in context .config .repositories :
47+ if ":" not in s :
48+ components += (s ,)
49+ else :
50+ key , value = s .split (":" , 1 )
51+ if key not in suite_components :
52+ suite_components [key ] = [value ]
53+ else :
54+ #suite_components[key] += (value,)
55+ suite_components [key ].append (value )
56+
4557 mirror = None if for_image else context .config .mirror
4658 snapshot = None if for_image else context .config .snapshot
4759
@@ -77,6 +89,19 @@ def repositories(cls, context: Context, for_image: bool = False) -> Iterable[Apt
7789 signedby = signedby ,
7890 )
7991
92+ for suite , comps in suite_components .items ():
93+ if snapshot :
94+ url = join_mirror (mirror , f"archive/{ suite } /{ snapshot } " )
95+ else :
96+ url = join_mirror (mirror , "debian" )
97+ yield AptRepository (
98+ types = types ,
99+ url = url ,
100+ suite = suite ,
101+ components = tuple (comps ),
102+ signedby = signedby ,
103+ )
104+
80105 # Debug repos are typically not mirrored.
81106 if snapshot :
82107 url = join_mirror (mirror , f"archive/debian-debug/{ snapshot } " )
0 commit comments