From 8a3c4424032325e8fa79e37f7bce51d37fd92946 Mon Sep 17 00:00:00 2001 From: Knight Date: Sun, 12 Jun 2016 15:54:29 +0800 Subject: [PATCH 1/7] Update README --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d64bc4869c..3cebaa5db7 100644 --- a/README.md +++ b/README.md @@ -357,11 +357,14 @@ Command | Description invocations. A toolchain with this name should be installed, or invocations will fail. -- `RUSTUP_DIST_ROOT` (default: `https://static.rust-lang.org/dist`) - Sets the root URL for downloading Rust toolchains and release - channel updates. You can change this to instead use a local mirror, +- `RUSTUP_DIST_SERVER` (default: `https://static.rust-lang.org`) + Sets the root URL for downloading static resources related to Rust. + You can change this to instead use a local mirror, or to test the binaries from the staging directory. +- `RUSTUP_DIST_ROOT` (default: `https://static.rust-lang.org/dist`) + Deprecated. Use `RUSTUP_DIST_SERVER` instead. + - `RUSTUP_UPDATE_ROOT` (default `https://static.rust-lang.org/rustup/dist`) Sets the root URL for downloading self-updates. From 19e808c7371fc4e349948531bd2918e04d3b1e87 Mon Sep 17 00:00:00 2001 From: Knight Date: Wed, 15 Jun 2016 13:50:31 +0800 Subject: [PATCH 2/7] mock::clitools: Use RUSTUP_DIST_SERVER instead --- src/rustup-mock/src/clitools.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rustup-mock/src/clitools.rs b/src/rustup-mock/src/clitools.rs index dcf6edba61..0327230022 100644 --- a/src/rustup-mock/src/clitools.rs +++ b/src/rustup-mock/src/clitools.rs @@ -226,7 +226,7 @@ pub fn cmd(config: &Config, name: &str, args: &[&str]) -> Command { pub fn env(config: &Config, cmd: &mut Command) { cmd.env("RUSTUP_HOME", config.rustupdir.to_string_lossy().to_string()); - cmd.env("RUSTUP_DIST_ROOT", format!("file://{}", config.distdir.join("dist").to_string_lossy())); + cmd.env("RUSTUP_DIST_SERVER", format!("file://{}", config.distdir.to_string_lossy())); cmd.env("CARGO_HOME", config.cargodir.to_string_lossy().to_string()); cmd.env("RUSTUP_OVERRIDE_HOST_TRIPLE", this_host_triple()); From 48252dbea09963243da1b4877bd80e6700b045dd Mon Sep 17 00:00:00 2001 From: Knight Date: Wed, 15 Jun 2016 13:51:46 +0800 Subject: [PATCH 3/7] rustup_dist::dist: Add const DEFAULT_DIST_SERVER --- src/rustup-dist/src/dist.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rustup-dist/src/dist.rs b/src/rustup-dist/src/dist.rs index b2d550ff51..e680539f00 100644 --- a/src/rustup-dist/src/dist.rs +++ b/src/rustup-dist/src/dist.rs @@ -15,9 +15,12 @@ use std::env; use regex::Regex; use sha2::{Sha256, Digest}; -pub const DEFAULT_DIST_ROOT: &'static str = "https://static.rust-lang.org/dist"; +pub const DEFAULT_DIST_SERVER: &'static str = "https://static.rust-lang.org"; pub const UPDATE_HASH_LEN: usize = 20; +// Deprecated +pub const DEFAULT_DIST_ROOT: &'static str = "https://static.rust-lang.org/dist"; + // A toolchain descriptor from rustup's perspective. These contain // 'partial target triples', which allow toolchain names like // 'stable-msvc' to work. Partial target triples though are parsed From 08af7cb50478f6333778463d406eb4843c02ddb8 Mon Sep 17 00:00:00 2001 From: Knight Date: Wed, 15 Jun 2016 14:13:56 +0800 Subject: [PATCH 4/7] rustup_dist::temp: Alter `struct Cfg` Add public member `dist_server: String` For the convenience of modifying the urls written in manifests, since the update functions can only access `temp_cfg`. In addition, the constructor function of `temp_cfg` accepts an additional `dist_root_server` now. --- src/rustup-dist/src/temp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rustup-dist/src/temp.rs b/src/rustup-dist/src/temp.rs index c65aa26efc..5ab1562bdd 100644 --- a/src/rustup-dist/src/temp.rs +++ b/src/rustup-dist/src/temp.rs @@ -37,6 +37,7 @@ pub enum Notification<'a> { pub struct Cfg { root_directory: PathBuf, + pub dist_server: String, notify_handler: Box, } @@ -131,9 +132,10 @@ impl Display for Error { } impl Cfg { - pub fn new(root_directory: PathBuf, notify_handler: Box) -> Self { + pub fn new(root_directory: PathBuf, dist_server: &str, notify_handler: Box) -> Self { Cfg { root_directory: root_directory, + dist_server: dist_server.to_owned(), notify_handler: notify_handler, } } From b7e2a6ebd4990eb63aa057ee0e001479119d17ee Mon Sep 17 00:00:00 2001 From: Knight Date: Wed, 15 Jun 2016 14:14:18 +0800 Subject: [PATCH 5/7] rustup::config: Alter `struct Cfg` and `fn from_env` Add two public members to `struct Cfg`: `dist_root_url: String` `dist_root_server: String` The reason I changed the type of `dist_root_url` from Cow to String is that I have to modify the original str and using String seems a bit handier. --- src/rustup/config.rs | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/rustup/config.rs b/src/rustup/config.rs index 9ecc35ba94..fedf44c48e 100644 --- a/src/rustup/config.rs +++ b/src/rustup/config.rs @@ -41,7 +41,8 @@ pub struct Cfg { pub temp_cfg: temp::Cfg, pub gpg_key: Cow<'static, str>, pub env_override: Option, - pub dist_root_url: Cow<'static, str>, + pub dist_root_url: String, + pub dist_root_server: String, pub notify_handler: Arc, } @@ -60,12 +61,6 @@ impl Cfg { let toolchains_dir = multirust_dir.join("toolchains"); let update_hash_dir = multirust_dir.join("update-hashes"); - let notify_clone = notify_handler.clone(); - let temp_cfg = temp::Cfg::new(multirust_dir.join("tmp"), - Box::new(move |n| { - (notify_clone)(n.into()) - })); - // GPG key let gpg_key = if let Some(path) = env::var_os("RUSTUP_GPG_KEY") .and_then(utils::if_not_empty) { @@ -79,10 +74,29 @@ impl Cfg { .ok() .and_then(utils::if_not_empty); - let dist_root_url = env::var("RUSTUP_DIST_ROOT") - .ok() - .and_then(utils::if_not_empty) - .map_or(Cow::Borrowed(dist::DEFAULT_DIST_ROOT), Cow::Owned); + let dist_root_server = match env::var("RUSTUP_DIST_SERVER") { + Ok(ref s) if !s.is_empty() => { + s.clone() + } + _ => { + // For backward compatibility + env::var("RUSTUP_DIST_ROOT") + .ok() + .and_then(utils::if_not_empty) + .map_or(Cow::Borrowed(dist::DEFAULT_DIST_ROOT), Cow::Owned) + .as_ref() + .trim_right_matches("/dist") + .to_owned() + } + }; + + let notify_clone = notify_handler.clone(); + let temp_cfg = temp::Cfg::new(multirust_dir.join("tmp"), + dist_root_server.as_str(), + Box::new(move |n| { + (notify_clone)(n.into()) + })); + let dist_root = dist_root_server.clone() + "/dist"; Ok(Cfg { multirust_dir: multirust_dir, @@ -93,7 +107,8 @@ impl Cfg { gpg_key: gpg_key, notify_handler: notify_handler, env_override: env_override, - dist_root_url: dist_root_url, + dist_root_url: dist_root, + dist_root_server: dist_root_server, }) } From 98b72861aeffa2a60655df5722214ea4798dee59 Mon Sep 17 00:00:00 2001 From: Knight Date: Wed, 15 Jun 2016 14:14:58 +0800 Subject: [PATCH 6/7] rustup_dist::manifestation: Modify urls in manifest --- src/rustup-dist/src/manifestation.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/rustup-dist/src/manifestation.rs b/src/rustup-dist/src/manifestation.rs index 9d37e5a41d..f66c997980 100644 --- a/src/rustup-dist/src/manifestation.rs +++ b/src/rustup-dist/src/manifestation.rs @@ -3,7 +3,7 @@ use config::Config; use manifest::{Component, Manifest, TargettedPackage}; -use dist::{download_and_check, DownloadCfg, TargetTriple}; +use dist::{download_and_check, DownloadCfg, TargetTriple, DEFAULT_DIST_SERVER}; use component::{Components, Transaction, TarGzPackage, Package}; use temp; use errors::*; @@ -122,6 +122,8 @@ impl Manifestation { components_urls_and_hashes.push(c_u_h); } + let altered = temp_cfg.dist_server != DEFAULT_DIST_SERVER; + // Download component packages and validate hashes let mut things_to_install: Vec<(Component, temp::File)> = Vec::new(); for (component, url, hash) in components_urls_and_hashes { @@ -129,6 +131,11 @@ impl Manifestation { notify_handler(Notification::DownloadingComponent(&component.pkg, &self.target_triple, &component.target)); + let url = if altered { + url.replace(DEFAULT_DIST_SERVER, temp_cfg.dist_server.as_str()) + } else { + url + }; // Download each package to temp file let temp_file = try!(temp_cfg.new_file()); @@ -301,7 +308,8 @@ impl Manifestation { return Err(format!("binary package was not provided for '{}'", self.target_triple.to_string()).into()); } - let url = url.unwrap(); + // Only replace once. The cost is inexpensive. + let url = url.unwrap().replace(DEFAULT_DIST_SERVER, temp_cfg.dist_server.as_str()); notify_handler(Notification::DownloadingComponent("rust", &self.target_triple, From 97633344d4086aa5db57851224c4a67114e550ef Mon Sep 17 00:00:00 2001 From: Knight Date: Wed, 15 Jun 2016 14:42:47 +0800 Subject: [PATCH 7/7] Make ci happy --- src/rustup-dist/tests/dist.rs | 3 +- src/rustup-dist/tests/install.rs | 13 ++++--- src/rustup-dist/tests/transactions.rs | 53 ++++++++++++++------------- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/rustup-dist/tests/dist.rs b/src/rustup-dist/tests/dist.rs index d4dd59b590..088549deca 100644 --- a/src/rustup-dist/tests/dist.rs +++ b/src/rustup-dist/tests/dist.rs @@ -17,7 +17,7 @@ use rustup_mock::{MockCommand, MockInstallerBuilder}; use rustup_dist::prefix::InstallPrefix; use rustup_dist::ErrorKind; use rustup_dist::errors::Result; -use rustup_dist::dist::{ToolchainDesc, TargetTriple}; +use rustup_dist::dist::{ToolchainDesc, TargetTriple, DEFAULT_DIST_SERVER}; use rustup_dist::download::DownloadCfg; use rustup_dist::Notification; use rustup_utils::utils; @@ -319,6 +319,7 @@ fn setup(edit: Option<&Fn(&str, &mut MockPackage)>, let work_tempdir = TempDir::new("multirust").unwrap(); let ref temp_cfg = temp::Cfg::new(work_tempdir.path().to_owned(), + DEFAULT_DIST_SERVER, Box::new(|_| ())); let ref url = Url::parse(&format!("file://{}", dist_tempdir.path().to_string_lossy())).unwrap(); diff --git a/src/rustup-dist/tests/install.rs b/src/rustup-dist/tests/install.rs index 196c779e75..b7758de456 100644 --- a/src/rustup-dist/tests/install.rs +++ b/src/rustup-dist/tests/install.rs @@ -6,6 +6,7 @@ extern crate tempdir; use rustup_dist::component::Components; use rustup_dist::component::{DirectoryPackage, Package}; use rustup_dist::component::Transaction; +use rustup_dist::dist::DEFAULT_DIST_SERVER; use rustup_dist::temp; use rustup_dist::ErrorKind; use rustup_dist::Notification; @@ -109,7 +110,7 @@ fn basic_install() { let prefix = InstallPrefix::from(instdir.path().to_owned()); let tmpdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let notify = |_: Notification| (); let tx = Transaction::new(prefix.clone(), &tmpcfg, ¬ify); @@ -147,7 +148,7 @@ fn multiple_component_install() { let prefix = InstallPrefix::from(instdir.path().to_owned()); let tmpdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let notify = |_: Notification| (); let tx = Transaction::new(prefix.clone(), &tmpcfg, ¬ify); @@ -190,7 +191,7 @@ fn uninstall() { let prefix = InstallPrefix::from(instdir.path().to_owned()); let tmpdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let notify = |_: Notification| (); let tx = Transaction::new(prefix.clone(), &tmpcfg, ¬ify); @@ -242,7 +243,7 @@ fn component_bad_version() { let prefix = InstallPrefix::from(instdir.path().to_owned()); let tmpdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let notify = |_: Notification| (); let tx = Transaction::new(prefix.clone(), &tmpcfg, ¬ify); @@ -288,7 +289,7 @@ fn unix_permissions() { let prefix = InstallPrefix::from(instdir.path().to_owned()); let tmpdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let notify = |_: Notification| (); let tx = Transaction::new(prefix.clone(), &tmpcfg, ¬ify); @@ -332,7 +333,7 @@ fn install_to_prefix_that_does_not_exist() { let prefix = InstallPrefix::from(does_not_exist.clone()); let tmpdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let notify = |_: Notification| (); let tx = Transaction::new(prefix.clone(), &tmpcfg, ¬ify); diff --git a/src/rustup-dist/tests/transactions.rs b/src/rustup-dist/tests/transactions.rs index 0e927fbd4c..3cef939ecd 100644 --- a/src/rustup-dist/tests/transactions.rs +++ b/src/rustup-dist/tests/transactions.rs @@ -4,11 +4,12 @@ extern crate tempdir; use rustup_dist::prefix::InstallPrefix; use rustup_dist::component::Transaction; +use rustup_dist::dist::DEFAULT_DIST_SERVER; use rustup_dist::temp; use rustup_dist::Notification; +use rustup_dist::ErrorKind; use rustup_utils::utils; use rustup_utils::raw as utils_raw; -use rustup_dist::ErrorKind; use tempdir::TempDir; use std::fs; use std::io::Write; @@ -21,7 +22,7 @@ fn add_file() { let prefix = InstallPrefix::from(prefixdir.path().to_owned()); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let notify = |_: Notification| (); let mut tx = Transaction::new(prefix.clone(), &tmpcfg, ¬ify); @@ -43,7 +44,7 @@ fn add_file_then_rollback() { let prefix = InstallPrefix::from(prefixdir.path().to_owned()); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let notify = |_: Notification| (); let mut tx = Transaction::new(prefix.clone(), &tmpcfg, ¬ify); @@ -59,7 +60,7 @@ fn add_file_that_exists() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -86,7 +87,7 @@ fn copy_file() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -108,7 +109,7 @@ fn copy_file_then_rollback() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -130,7 +131,7 @@ fn copy_file_that_exists() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -160,7 +161,7 @@ fn copy_dir() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -190,7 +191,7 @@ fn copy_dir_then_rollback() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -220,7 +221,7 @@ fn copy_dir_that_exists() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -245,7 +246,7 @@ fn remove_file() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -266,7 +267,7 @@ fn remove_file_then_rollback() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -287,7 +288,7 @@ fn remove_file_that_not_exists() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -310,7 +311,7 @@ fn remove_dir() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -332,7 +333,7 @@ fn remove_dir_then_rollback() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -354,7 +355,7 @@ fn remove_dir_that_not_exists() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -377,7 +378,7 @@ fn write_file() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -399,7 +400,7 @@ fn write_file_then_rollback() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -418,7 +419,7 @@ fn write_file_that_exists() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -445,7 +446,7 @@ fn modify_file_that_not_exists() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -465,7 +466,7 @@ fn modify_file_that_exists() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -485,7 +486,7 @@ fn modify_file_that_not_exists_then_rollback() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -503,7 +504,7 @@ fn modify_file_that_exists_then_rollback() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -526,7 +527,7 @@ fn modify_twice_then_rollback() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -549,7 +550,7 @@ fn do_multiple_op_transaction(rollback: bool) { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned()); @@ -645,7 +646,7 @@ fn rollback_failure_keeps_going() { let prefixdir = TempDir::new("multirust").unwrap(); let txdir = TempDir::new("multirust").unwrap(); - let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ())); + let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ())); let prefix = InstallPrefix::from(prefixdir.path().to_owned());