3434 DebianArch ("riscv64" , "riscv64" , "linux/riscv64" , "riscv64gc-unknown-linux-gnu" ),
3535]
3636
37- DebianVariant = namedtuple ("DebianVariant" , ["name" , "arches" ])
38-
39- debian_variants = [
40- DebianVariant ("bullseye" , debian_lts_arches ),
41- DebianVariant ("bookworm" , debian_lts_arches + debian_non_lts_arches ),
42- DebianVariant ("trixie" , debian_lts_arches + debian_non_lts_arches + debian_trixie_arches ),
37+ latest_debian_release = "trixie"
38+
39+ DebianRelease = namedtuple ("DebianRelease" , ["name" , "arches" ])
40+
41+ debian_releases = [
42+ DebianRelease ("bullseye" , debian_lts_arches ),
43+ DebianRelease ("bookworm" , debian_lts_arches + debian_non_lts_arches ),
44+ DebianRelease (latest_debian_release , debian_lts_arches + debian_non_lts_arches + debian_trixie_arches ),
4345]
4446
45- default_debian_variant = "trixie"
46-
4747AlpineArch = namedtuple ("AlpineArch" , ["bashbrew" , "apk" , "qemu" , "rust" ])
4848
4949alpine_arches = [
@@ -83,28 +83,28 @@ def update_debian():
8383 template = read_file ("Dockerfile-debian.template" )
8484 slim_template = read_file ("Dockerfile-slim.template" )
8585
86- for variant in debian_variants :
86+ for release in debian_releases :
8787 arch_case = 'dpkgArch="$(dpkg --print-architecture)"; \\ \n '
8888 arch_case += ' case "${dpkgArch##*-}" in \\ \n '
89- for arch in variant .arches :
90- hash = rustup_hash (arch .rust )
91- arch_case += f" { arch .dpkg } ) rustArch='{ arch .rust } '; rustupSha256='{ hash } ' ;; \\ \n "
89+ for debian_arch in release .arches :
90+ hash = rustup_hash (debian_arch .rust )
91+ arch_case += f" { debian_arch .dpkg } ) rustArch='{ debian_arch .rust } '; rustupSha256='{ hash } ' ;; \\ \n "
9292 arch_case += end
9393
9494 for channel in supported_channels :
9595 rendered = template \
9696 .replace ("%%RUST-VERSION%%" , channel .rust_version ) \
9797 .replace ("%%RUSTUP-VERSION%%" , rustup_version ) \
98- .replace ("%%DEBIAN-SUITE%%" , variant .name ) \
98+ .replace ("%%DEBIAN-SUITE%%" , release .name ) \
9999 .replace ("%%ARCH-CASE%%" , arch_case )
100- write_file (f"{ channel .name } /{ variant .name } /Dockerfile" , rendered )
100+ write_file (f"{ channel .name } /{ release .name } /Dockerfile" , rendered )
101101
102102 rendered = slim_template \
103103 .replace ("%%RUST-VERSION%%" , channel .rust_version ) \
104104 .replace ("%%RUSTUP-VERSION%%" , rustup_version ) \
105- .replace ("%%DEBIAN-SUITE%%" , variant .name ) \
105+ .replace ("%%DEBIAN-SUITE%%" , release .name ) \
106106 .replace ("%%ARCH-CASE%%" , arch_case )
107- write_file (f"{ channel .name } /{ variant .name } /slim/Dockerfile" , rendered )
107+ write_file (f"{ channel .name } /{ release .name } /slim/Dockerfile" , rendered )
108108
109109def update_alpine ():
110110 arch_case = 'apkArch="$(apk --print-arch)"; \\ \n '
@@ -135,11 +135,11 @@ def update_ci():
135135 rendered = split [0 ] + marker + f" RUST_VERSION: { stable .rust_version } \n " + marker + split [2 ]
136136
137137 versions = ""
138- for variant in debian_variants :
139- versions += f" - name: { variant .name } \n "
140- versions += f" variant: { variant .name } \n "
141- versions += f" - name: slim-{ variant .name } \n "
142- versions += f" variant: { variant .name } /slim\n "
138+ for release in debian_releases :
139+ versions += f" - name: { release .name } \n "
140+ versions += f" variant: { release .name } \n "
141+ versions += f" - name: slim-{ release .name } \n "
142+ versions += f" variant: { release .name } /slim\n "
143143
144144 for version in alpine_versions :
145145 versions += f" - name: alpine{ version } \n "
@@ -170,31 +170,31 @@ def update_mirror_stable_ci():
170170 for tag in tags :
171171 versions += f" { tag } \n "
172172
173- for variant in debian_variants :
173+ for release in debian_releases :
174174 tags = []
175175 for version_tag in version_tags ():
176- tags .append (f"{ version_tag } -{ variant .name } " )
177- tags .append (variant .name )
178- if variant .name == default_debian_variant :
176+ tags .append (f"{ version_tag } -{ release .name } " )
177+ tags .append (release .name )
178+ if release .name == latest_debian_release :
179179 for version_tag in version_tags ():
180180 tags .append (version_tag )
181181 tags .append ("latest" )
182182
183- versions += f" - name: { variant .name } \n "
183+ versions += f" - name: { release .name } \n "
184184 versions += " tags: |\n "
185185 for tag in tags :
186186 versions += f" { tag } \n "
187187
188188 tags = []
189189 for version_tag in version_tags ():
190- tags .append (f"{ version_tag } -slim-{ variant .name } " )
191- tags .append (f"slim-{ variant .name } " )
192- if variant .name == default_debian_variant :
190+ tags .append (f"{ version_tag } -slim-{ release .name } " )
191+ tags .append (f"slim-{ release .name } " )
192+ if release .name == latest_debian_release :
193193 for version_tag in version_tags ():
194194 tags .append (f"{ version_tag } -slim" )
195195 tags .append ("slim" )
196196
197- versions += f" - name: slim-{ variant .name } \n "
197+ versions += f" - name: slim-{ release .name } \n "
198198 versions += " tags: |\n "
199199 for tag in tags :
200200 versions += f" { tag } \n "
@@ -211,25 +211,25 @@ def update_nightly_ci():
211211
212212
213213 versions = ""
214- for variant in debian_variants :
214+ for release in debian_releases :
215215 platforms = []
216- for arch in variant .arches :
216+ for arch in release .arches :
217217 platforms .append (f"{ arch .qemu } " )
218218 platforms = "," .join (platforms )
219219
220- tags = [f"nightly-{ variant .name } " ]
221- if variant .name == default_debian_variant :
220+ tags = [f"nightly-{ release .name } " ]
221+ if release .name == latest_debian_release :
222222 tags .append ("nightly" )
223223
224- versions += f" - name: { variant .name } \n "
225- versions += f" context: nightly/{ variant .name } \n "
224+ versions += f" - name: { release .name } \n "
225+ versions += f" context: nightly/{ release .name } \n "
226226 versions += f" platforms: { platforms } \n "
227227 versions += " tags: |\n "
228228 for tag in tags :
229229 versions += f" { tag } \n "
230230
231- versions += f" - name: slim-{ variant .name } \n "
232- versions += f" context: nightly/{ variant .name } /slim\n "
231+ versions += f" - name: slim-{ release .name } \n "
232+ versions += f" context: nightly/{ release .name } /slim\n "
233233 versions += f" platforms: { platforms } \n "
234234 versions += " tags: |\n "
235235 for tag in tags :
@@ -292,36 +292,36 @@ def generate_stackbrew_library():
292292GitRepo: https://github.com/rust-lang/docker-rust.git
293293"""
294294
295- for variant in debian_variants :
295+ for release in debian_releases :
296296 tags = []
297297 for version_tag in version_tags ():
298- tags .append (f"{ version_tag } -{ variant .name } " )
299- tags .append (variant .name )
300- if variant .name == default_debian_variant :
298+ tags .append (f"{ version_tag } -{ release .name } " )
299+ tags .append (release .name )
300+ if release .name == latest_debian_release :
301301 for version_tag in version_tags ():
302302 tags .append (version_tag )
303303 tags .append ("latest" )
304304
305- arches = variant .arches [:]
305+ arches = release .arches [:]
306306
307307 library += single_library (
308308 tags ,
309309 map (lambda a : a .bashbrew , arches ),
310- os .path .join (stable .name , variant .name ))
310+ os .path .join (stable .name , release .name ))
311311
312312 tags = []
313313 for version_tag in version_tags ():
314- tags .append (f"{ version_tag } -slim-{ variant .name } " )
315- tags .append (f"slim-{ variant .name } " )
316- if variant .name == default_debian_variant :
314+ tags .append (f"{ version_tag } -slim-{ release .name } " )
315+ tags .append (f"slim-{ release .name } " )
316+ if release .name == latest_debian_release :
317317 for version_tag in version_tags ():
318318 tags .append (f"{ version_tag } -slim" )
319319 tags .append ("slim" )
320320
321321 library += single_library (
322322 tags ,
323323 map (lambda a : a .bashbrew , arches ),
324- os .path .join (stable .name , variant .name , "slim" ))
324+ os .path .join (stable .name , release .name , "slim" ))
325325
326326 for version in alpine_versions :
327327 tags = []
0 commit comments