File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -497,6 +497,32 @@ pub fn update_from_dist<'a>(download: DownloadCfg<'a>,
497497 remove : & [ Component ] )
498498 -> Result < Option < String > > {
499499
500+ let fresh_install = !prefix. path ( ) . exists ( ) ;
501+
502+ let res = update_from_dist_ ( download,
503+ update_hash,
504+ toolchain,
505+ prefix,
506+ add,
507+ remove) ;
508+
509+ if res. is_err ( ) && fresh_install {
510+ // FIXME Ignoring cascading errors
511+ let _ = utils:: remove_dir ( "toolchain" , prefix. path ( ) ,
512+ & |n| ( download. notify_handler ) ( n. into ( ) ) ) ;
513+ }
514+
515+ res
516+ }
517+
518+ pub fn update_from_dist_ < ' a > ( download : DownloadCfg < ' a > ,
519+ update_hash : Option < & Path > ,
520+ toolchain : & ToolchainDesc ,
521+ prefix : & InstallPrefix ,
522+ add : & [ Component ] ,
523+ remove : & [ Component ] )
524+ -> Result < Option < String > > {
525+
500526 let toolchain_str = toolchain. to_string ( ) ;
501527 let manifestation = try!( Manifestation :: open ( prefix. clone ( ) , toolchain. target . clone ( ) ) ) ;
502528
You can’t perform that action at this time.
0 commit comments