@@ -6,8 +6,7 @@ use tar::Archive;
66use flate2:: { GzBuilder , Compression } ;
77use flate2:: read:: GzDecoder ;
88
9- use core:: source:: { Source , SourceId } ;
10- use core:: Package ;
9+ use core:: { Source , SourceId , Package , PackageId } ;
1110use sources:: PathSource ;
1211use util:: { self , CargoResult , human, internal, ChainError , Config } ;
1312use ops;
@@ -160,16 +159,23 @@ fn run_verify(config: &Config, pkg: &Package, tar: &Path)
160159 // When packages are uploaded to the registry, all path dependencies are
161160 // implicitly converted to registry-based dependencies, so we rewrite those
162161 // dependencies here.
162+ //
163+ // We also be sure to point all paths at `dst` instead of the previous
164+ // location that the package was original read from. In locking the
165+ // `SourceId` we're telling it that the corresponding `PathSource` will be
166+ // considered updated and won't actually read any packages.
163167 let registry = try!( SourceId :: for_central ( config) ) ;
168+ let precise = Some ( "locked" . to_string ( ) ) ;
169+ let new_src = try!( SourceId :: for_path ( & dst) ) . with_precise ( precise) ;
170+ let new_pkgid = try!( PackageId :: new ( pkg. name ( ) , pkg. version ( ) , & new_src) ) ;
164171 let new_summary = pkg. summary ( ) . clone ( ) . map_dependencies ( |d| {
165172 if !d. source_id ( ) . is_path ( ) { return d }
166173 d. set_source_id ( registry. clone ( ) )
167174 } ) ;
168175 let mut new_manifest = pkg. manifest ( ) . clone ( ) ;
169- new_manifest. set_summary ( new_summary) ;
176+ new_manifest. set_summary ( new_summary. override_id ( new_pkgid ) ) ;
170177 new_manifest. set_target_dir ( dst. join ( "target" ) ) ;
171- let new_pkg = Package :: new ( new_manifest, & manifest_path,
172- pkg. package_id ( ) . source_id ( ) ) ;
178+ let new_pkg = Package :: new ( new_manifest, & manifest_path, & new_src) ;
173179
174180 // Now that we've rewritten all our path dependencies, compile it!
175181 try!( ops:: compile_pkg ( & new_pkg, & ops:: CompileOptions {
0 commit comments