@@ -111,14 +111,14 @@ fn sync(
111
111
opts : & VendorOptions < ' _ > ,
112
112
) -> CargoResult < VendorConfig > {
113
113
let dry_run = false ;
114
- let canonical_destination = try_canonicalize ( opts. destination ) ;
115
- let canonical_destination = canonical_destination . as_deref ( ) . unwrap_or ( opts. destination ) ;
116
- let dest_dir_already_exists = canonical_destination . exists ( ) ;
114
+ let vendor_dir = try_canonicalize ( opts. destination ) ;
115
+ let vendor_dir = vendor_dir . as_deref ( ) . unwrap_or ( opts. destination ) ;
116
+ let vendor_dir_already_exists = vendor_dir . exists ( ) ;
117
117
118
- paths:: create_dir_all ( & canonical_destination ) ?;
118
+ paths:: create_dir_all ( & vendor_dir ) ?;
119
119
let mut to_remove = HashSet :: new ( ) ;
120
120
if !opts. no_delete {
121
- for entry in canonical_destination . read_dir ( ) ? {
121
+ for entry in vendor_dir . read_dir ( ) ? {
122
122
let entry = entry?;
123
123
if !entry
124
124
. file_name ( )
@@ -247,7 +247,7 @@ fn sync(
247
247
} ;
248
248
249
249
sources. insert ( id. source_id ( ) ) ;
250
- let dst = canonical_destination . join ( & dst_name) ;
250
+ let dst = vendor_dir . join ( & dst_name) ;
251
251
to_remove. remove ( & dst) ;
252
252
let cksum = dst. join ( ".cargo-checksum.json" ) ;
253
253
// Registries are the only immutable sources,
@@ -265,14 +265,14 @@ fn sync(
265
265
let _ = fs:: remove_dir_all ( & dst) ;
266
266
let pathsource = PathSource :: new ( src, id. source_id ( ) , gctx) ;
267
267
let paths = pathsource. list_files ( pkg) ?;
268
- let mut map = BTreeMap :: new ( ) ;
269
- cp_sources ( pkg, src, & paths, & dst, & mut map , & mut tmp_buf, gctx)
268
+ let mut file_cksums = BTreeMap :: new ( ) ;
269
+ cp_sources ( pkg, src, & paths, & dst, & mut file_cksums , & mut tmp_buf, gctx)
270
270
. with_context ( || format ! ( "failed to copy over vendored sources for: {}" , id) ) ?;
271
271
272
272
// Finally, emit the metadata about this package
273
273
let json = serde_json:: json!( {
274
274
"package" : checksums. get( id) ,
275
- "files" : map ,
275
+ "files" : file_cksums ,
276
276
} ) ;
277
277
278
278
paths:: write ( & cksum, json. to_string ( ) ) ?;
@@ -347,9 +347,9 @@ fn sync(
347
347
directory : opts. destination . to_string_lossy ( ) . replace ( "\\ " , "/" ) ,
348
348
} ,
349
349
) ;
350
- } else if !dest_dir_already_exists {
350
+ } else if !vendor_dir_already_exists {
351
351
// Nothing to vendor. Remove the destination dir we've just created.
352
- paths:: remove_dir ( canonical_destination ) ?;
352
+ paths:: remove_dir ( vendor_dir ) ?;
353
353
}
354
354
355
355
Ok ( VendorConfig { source : config } )
0 commit comments