1
Fork 0

bootstrap.py: Use loop for _download_component_helper

This commit is contained in:
Nilstrieb 2023-04-16 21:34:55 +02:00
parent 488da69ce9
commit fa4639195c

View file

@ -437,16 +437,17 @@ class RustBuild(object):
os.makedirs(rustc_cache) os.makedirs(rustc_cache)
tarball_suffix = '.tar.gz' if lzma is None else '.tar.xz' tarball_suffix = '.tar.gz' if lzma is None else '.tar.xz'
filename = "rust-std-{}-{}{}".format(
rustc_channel, self.build, tarball_suffix) tarballs_to_download = [
pattern = "rust-std-{}".format(self.build) ("rust-std-{}-{}{}".format(rustc_channel, self.build, tarball_suffix),
self._download_component_helper(filename, pattern, tarball_suffix, rustc_cache) "rust-std-{}".format(self.build)),
filename = "rustc-{}-{}{}".format(rustc_channel, self.build, ("rustc-{}-{}{}".format(rustc_channel, self.build, tarball_suffix), "rustc"),
tarball_suffix) ("cargo-{}-{}{}".format(rustc_channel, self.build, tarball_suffix), "cargo"),
self._download_component_helper(filename, "rustc", tarball_suffix, rustc_cache) ]
filename = "cargo-{}-{}{}".format(rustc_channel, self.build,
tarball_suffix) for filename, pattern in tarballs_to_download:
self._download_component_helper(filename, "cargo", tarball_suffix, rustc_cache) self._download_component_helper(filename, pattern, tarball_suffix, rustc_cache)
if self.should_fix_bins_and_dylibs(): if self.should_fix_bins_and_dylibs():
self.fix_bin_or_dylib("{}/bin/cargo".format(bin_root)) self.fix_bin_or_dylib("{}/bin/cargo".format(bin_root))