@@ -181,7 +181,10 @@ pub trait CtxMethods {
181181 /// second is a list of declared and discovered inputs
182182 fn install ( & self , src : PkgSrc ) -> ( ~[ Path ] , ~[ ( ~str , ~str ) ] ) ;
183183 /// Returns a list of installed files
184- fn install_no_build ( & self , workspace : & Path , id : & PkgId ) -> ~[ Path ] ;
184+ fn install_no_build ( & self ,
185+ source_workspace : & Path ,
186+ target_workspace : & Path ,
187+ id : & PkgId ) -> ~[ Path ] ;
185188 fn prefer ( & self , _id : & str , _vers : Option < ~str > ) ;
186189 fn test ( & self ) ;
187190 fn uninstall ( & self , _id : & str , _vers : Option < ~str > ) ;
@@ -464,28 +467,40 @@ impl CtxMethods for BuildContext {
464467 // install to the first workspace in the RUST_PATH if there's
465468 // a non-default RUST_PATH. This code installs to the same
466469 // workspace the package was built in.
467- debug ! ( "install: destination workspace = %s, id = %s" ,
468- destination_workspace, id_str) ;
469- let result = subself. install_no_build ( & Path ( destination_workspace) , & sub_id) ;
470+ let actual_workspace = if path_util:: user_set_rust_path ( ) {
471+ default_workspace ( )
472+ }
473+ else {
474+ Path ( destination_workspace)
475+ } ;
476+ debug ! ( "install: destination workspace = %s, id = %s, installing to %s" ,
477+ destination_workspace, id_str, actual_workspace. to_str( ) ) ;
478+ let result = subself. install_no_build ( & Path ( destination_workspace) ,
479+ & actual_workspace,
480+ & sub_id) ;
470481 debug ! ( "install: id = %s, about to call discover_outputs, %?" ,
471482 id_str, result. to_str( ) ) ;
472483
473484 discover_outputs ( exec, result. clone ( ) ) ;
474485 sub_files. write ( |r| { * r = result. clone ( ) ; } ) ;
475486 sub_inputs. write ( |r| { * r = * r + exec. lookup_discovered_inputs ( ) } ) ;
487+ note ( fmt ! ( "Installed package %s to %s" , id_str, actual_workspace. to_str( ) ) ) ;
476488 }
477489 } ;
478490 ( installed_files. unwrap ( ) , inputs. unwrap ( ) )
479491 }
480492
481- fn install_no_build ( & self , workspace : & Path , id : & PkgId ) -> ~[ Path ] {
493+ fn install_no_build ( & self ,
494+ source_workspace : & Path ,
495+ target_workspace : & Path ,
496+ id : & PkgId ) -> ~[ Path ] {
482497 use conditions:: copy_failed:: cond;
483498
484499 // Now copy stuff into the install dirs
485- let maybe_executable = built_executable_in_workspace ( id, workspace ) ;
486- let maybe_library = built_library_in_workspace ( id, workspace ) ;
487- let target_exec = target_executable_in_workspace ( id, workspace ) ;
488- let target_lib = maybe_library. map ( |_p| target_library_in_workspace ( id, workspace ) ) ;
500+ let maybe_executable = built_executable_in_workspace ( id, source_workspace ) ;
501+ let maybe_library = built_library_in_workspace ( id, source_workspace ) ;
502+ let target_exec = target_executable_in_workspace ( id, target_workspace ) ;
503+ let target_lib = maybe_library. map ( |_p| target_library_in_workspace ( id, target_workspace ) ) ;
489504
490505 debug ! ( "target_exec = %s target_lib = %? \
491506 maybe_executable = %? maybe_library = %?",
0 commit comments