@@ -4,11 +4,12 @@ extern crate tempdir;
44
55use rustup_dist:: prefix:: InstallPrefix ;
66use rustup_dist:: component:: Transaction ;
7+ use rustup_dist:: dist:: DEFAULT_DIST_SERVER ;
78use rustup_dist:: temp;
89use rustup_dist:: Notification ;
10+ use rustup_dist:: ErrorKind ;
911use rustup_utils:: utils;
1012use rustup_utils:: raw as utils_raw;
11- use rustup_dist:: ErrorKind ;
1213use tempdir:: TempDir ;
1314use std:: fs;
1415use std:: io:: Write ;
@@ -21,7 +22,7 @@ fn add_file() {
2122
2223 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
2324
24- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
25+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
2526
2627 let notify = |_: Notification | ( ) ;
2728 let mut tx = Transaction :: new ( prefix. clone ( ) , & tmpcfg, & notify) ;
@@ -43,7 +44,7 @@ fn add_file_then_rollback() {
4344
4445 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
4546
46- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
47+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
4748
4849 let notify = |_: Notification | ( ) ;
4950 let mut tx = Transaction :: new ( prefix. clone ( ) , & tmpcfg, & notify) ;
@@ -59,7 +60,7 @@ fn add_file_that_exists() {
5960 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
6061 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
6162
62- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
63+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
6364
6465 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
6566
@@ -86,7 +87,7 @@ fn copy_file() {
8687 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
8788 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
8889
89- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
90+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
9091
9192 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
9293
@@ -108,7 +109,7 @@ fn copy_file_then_rollback() {
108109 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
109110 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
110111
111- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
112+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
112113
113114 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
114115
@@ -130,7 +131,7 @@ fn copy_file_that_exists() {
130131 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
131132 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
132133
133- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
134+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
134135
135136 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
136137
@@ -160,7 +161,7 @@ fn copy_dir() {
160161 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
161162 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
162163
163- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
164+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
164165
165166 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
166167
@@ -190,7 +191,7 @@ fn copy_dir_then_rollback() {
190191 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
191192 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
192193
193- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
194+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
194195
195196 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
196197
@@ -220,7 +221,7 @@ fn copy_dir_that_exists() {
220221 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
221222 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
222223
223- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
224+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
224225
225226 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
226227
@@ -245,7 +246,7 @@ fn remove_file() {
245246 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
246247 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
247248
248- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
249+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
249250
250251 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
251252
@@ -266,7 +267,7 @@ fn remove_file_then_rollback() {
266267 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
267268 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
268269
269- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
270+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
270271
271272 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
272273
@@ -287,7 +288,7 @@ fn remove_file_that_not_exists() {
287288 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
288289 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
289290
290- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
291+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
291292
292293 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
293294
@@ -310,7 +311,7 @@ fn remove_dir() {
310311 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
311312 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
312313
313- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
314+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
314315
315316 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
316317
@@ -332,7 +333,7 @@ fn remove_dir_then_rollback() {
332333 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
333334 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
334335
335- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
336+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
336337
337338 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
338339
@@ -354,7 +355,7 @@ fn remove_dir_that_not_exists() {
354355 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
355356 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
356357
357- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
358+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
358359
359360 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
360361
@@ -377,7 +378,7 @@ fn write_file() {
377378 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
378379 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
379380
380- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
381+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
381382
382383 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
383384
@@ -399,7 +400,7 @@ fn write_file_then_rollback() {
399400 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
400401 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
401402
402- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
403+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
403404
404405 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
405406
@@ -418,7 +419,7 @@ fn write_file_that_exists() {
418419 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
419420 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
420421
421- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
422+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
422423
423424 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
424425
@@ -445,7 +446,7 @@ fn modify_file_that_not_exists() {
445446 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
446447 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
447448
448- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
449+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
449450
450451 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
451452
@@ -465,7 +466,7 @@ fn modify_file_that_exists() {
465466 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
466467 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
467468
468- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
469+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
469470
470471 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
471472
@@ -485,7 +486,7 @@ fn modify_file_that_not_exists_then_rollback() {
485486 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
486487 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
487488
488- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
489+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
489490
490491 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
491492
@@ -503,7 +504,7 @@ fn modify_file_that_exists_then_rollback() {
503504 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
504505 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
505506
506- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
507+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
507508
508509 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
509510
@@ -526,7 +527,7 @@ fn modify_twice_then_rollback() {
526527 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
527528 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
528529
529- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
530+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
530531
531532 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
532533
@@ -549,7 +550,7 @@ fn do_multiple_op_transaction(rollback: bool) {
549550 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
550551 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
551552
552- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
553+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
553554
554555 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
555556
@@ -645,7 +646,7 @@ fn rollback_failure_keeps_going() {
645646 let prefixdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
646647 let txdir = TempDir :: new ( "multirust" ) . unwrap ( ) ;
647648
648- let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , Box :: new ( |_| ( ) ) ) ;
649+ let tmpcfg = temp:: Cfg :: new ( txdir. path ( ) . to_owned ( ) , DEFAULT_DIST_SERVER , Box :: new ( |_| ( ) ) ) ;
649650
650651 let prefix = InstallPrefix :: from ( prefixdir. path ( ) . to_owned ( ) ) ;
651652
0 commit comments