@@ -43,9 +43,9 @@ pub struct PkgSrc {
43
43
44
44
impl ToStr for PkgSrc {
45
45
fn to_str ( & self ) -> ~str {
46
- fmt ! ( "Package ID %s in start dir %s [workspace = %s ]" ,
47
- self . id. to_str( ) ,
48
- self . start_dir. to_str( ) , self . workspace. to_str( ) )
46
+ format ! ( "Package ID {} in start dir {} [workspace = {} ]" ,
47
+ self . id. to_str( ) ,
48
+ self . start_dir. to_str( ) , self . workspace. to_str( ) )
49
49
}
50
50
}
51
51
condition ! {
@@ -58,21 +58,21 @@ impl PkgSrc {
58
58
pub fn new( workspace : Path , use_rust_path_hack : bool , id : PkgId ) -> PkgSrc {
59
59
use conditions:: nonexistent_package:: cond;
60
60
61
- debug ! ( "Checking package source for package ID %s , \
62
- workspace = %s use_rust_path_hack = %? ",
61
+ debug2 ! ( "Checking package source for package ID {} , \
62
+ workspace = {} use_rust_path_hack = {:?} ",
63
63
id. to_str( ) , workspace. to_str( ) , use_rust_path_hack) ;
64
64
65
65
let mut to_try = ~[ ] ;
66
66
if use_rust_path_hack {
67
67
to_try. push ( workspace. clone ( ) ) ;
68
68
} else {
69
- let result = workspace. push ( "src" ) . push_rel ( & id. path . pop ( ) ) . push ( fmt ! ( "%s-%s " ,
69
+ let result = workspace. push ( "src" ) . push_rel ( & id. path . pop ( ) ) . push ( format ! ( "{}-{} " ,
70
70
id. short_name, id. version. to_str( ) ) ) ;
71
71
to_try. push ( result) ;
72
72
to_try. push ( workspace. push ( "src" ) . push_rel ( & id. path ) ) ;
73
73
}
74
74
75
- debug ! ( "Checking dirs: %? " , to_try. map( |s| s. to_str( ) ) . connect( ":" ) ) ;
75
+ debug2 ! ( "Checking dirs: {:?} " , to_try. map( |s| s. to_str( ) ) . connect( ":" ) ) ;
76
76
77
77
let path = to_try. iter ( ) . find ( |& d| os:: path_exists ( d) ) ;
78
78
@@ -84,13 +84,13 @@ impl PkgSrc {
84
84
for ( prefix, suffix) in id. prefixes_iter ( ) {
85
85
let package_id = PkgId :: new ( prefix. to_str ( ) ) ;
86
86
let path = workspace. push ( "src" ) . push_rel ( & package_id. path ) ;
87
- debug ! ( "in loop: checking if %s is a directory" , path. to_str( ) ) ;
87
+ debug2 ! ( "in loop: checking if {} is a directory" , path. to_str( ) ) ;
88
88
if os:: path_is_dir ( & path) {
89
89
let ps = PkgSrc :: new ( workspace. clone ( ) ,
90
90
use_rust_path_hack,
91
91
PkgId :: new ( prefix. to_str ( ) ) ) ;
92
- debug ! ( "pkgsrc: Returning [%s|%s|%s ]" , workspace. to_str( ) ,
93
- ps. start_dir. push_rel( & suffix) . to_str( ) , ps. id. to_str( ) ) ;
92
+ debug2 ! ( "pkgsrc: Returning [{}|{}|{} ]" , workspace. to_str( ) ,
93
+ ps. start_dir. push_rel( & suffix) . to_str( ) , ps. id. to_str( ) ) ;
94
94
95
95
return PkgSrc {
96
96
workspace : workspace,
@@ -108,7 +108,7 @@ impl PkgSrc {
108
108
// Ok, no prefixes work, so try fetching from git
109
109
let mut ok_d = None ;
110
110
for w in to_try. iter ( ) {
111
- debug ! ( "Calling fetch_git on %s " , w. to_str( ) ) ;
111
+ debug2 ! ( "Calling fetch_git on {} " , w. to_str( ) ) ;
112
112
let gf = PkgSrc :: fetch_git ( w, & id) ;
113
113
for p in gf. iter ( ) {
114
114
ok_d = Some ( p. clone ( ) ) ;
@@ -138,14 +138,14 @@ impl PkgSrc {
138
138
}
139
139
}
140
140
} ;
141
- debug ! ( "For package id %s , returning %s " , id. to_str( ) , dir. to_str( ) ) ;
141
+ debug2 ! ( "For package id {} , returning {} " , id. to_str( ) , dir. to_str( ) ) ;
142
142
143
143
if !os:: path_is_dir ( & dir) {
144
144
cond. raise ( ( id. clone ( ) , ~"supplied path for package dir is a \
145
145
non-directory") ) ;
146
146
}
147
147
148
- debug ! ( "pkgsrc: Returning {%s|%s|%s }" , workspace. to_str( ) ,
148
+ debug2 ! ( "pkgsrc: Returning \\ {{}|{}|{} \\ }" , workspace. to_str( ) ,
149
149
dir. to_str( ) , id. to_str( ) ) ;
150
150
151
151
PkgSrc {
@@ -176,13 +176,13 @@ impl PkgSrc {
176
176
None => cond. raise ( ~"Failed to create temporary directory for fetching git sources")
177
177
} ;
178
178
179
- debug ! ( "Checking whether %s (path = %s ) exists locally. Cwd = %s , does it? %? " ,
179
+ debug2 ! ( "Checking whether {} (path = {} ) exists locally. Cwd = {} , does it? {:?} " ,
180
180
pkgid. to_str( ) , pkgid. path. to_str( ) ,
181
181
os:: getcwd( ) . to_str( ) ,
182
182
os:: path_exists( & pkgid. path) ) ;
183
183
184
184
if os:: path_exists ( & pkgid. path ) {
185
- debug ! ( "%s exists locally! Cloning it into %s " ,
185
+ debug2 ! ( "{} exists locally! Cloning it into {} " ,
186
186
pkgid. path. to_str( ) , local. to_str( ) ) ;
187
187
// Ok to use local here; we know it will succeed
188
188
git_clone ( & pkgid. path , local, & pkgid. version ) ;
@@ -194,8 +194,8 @@ impl PkgSrc {
194
194
return None ;
195
195
}
196
196
197
- let url = fmt ! ( "https://%s " , pkgid. path. to_str( ) ) ;
198
- debug ! ( "Fetching package: git clone %s %s [version=%s ]" ,
197
+ let url = format ! ( "https://{} " , pkgid. path. to_str( ) ) ;
198
+ debug2 ! ( "Fetching package: git clone {} {} [version={} ]" ,
199
199
url, clone_target. to_str( ) , pkgid. version. to_str( ) ) ;
200
200
201
201
if git_clone_general ( url, & clone_target, & pkgid. version ) {
@@ -219,7 +219,7 @@ impl PkgSrc {
219
219
// return the path for it. Otherwise, None
220
220
pub fn package_script_option ( & self ) -> Option < Path > {
221
221
let maybe_path = self . start_dir . push ( "pkg.rs" ) ;
222
- debug ! ( "package_script_option: checking whether %s exists" , maybe_path. to_str( ) ) ;
222
+ debug2 ! ( "package_script_option: checking whether {} exists" , maybe_path. to_str( ) ) ;
223
223
if os:: path_exists ( & maybe_path) {
224
224
Some ( maybe_path)
225
225
}
@@ -239,7 +239,7 @@ impl PkgSrc {
239
239
for c in p. components . slice ( prefix, p. components . len ( ) ) . iter ( ) {
240
240
sub = sub. push ( * c) ;
241
241
}
242
- debug ! ( "Will compile crate %s " , sub. to_str( ) ) ;
242
+ debug2 ! ( "Will compile crate {} " , sub. to_str( ) ) ;
243
243
cs. push ( Crate :: new ( & sub) ) ;
244
244
}
245
245
@@ -253,7 +253,7 @@ impl PkgSrc {
253
253
use conditions:: missing_pkg_files:: cond;
254
254
255
255
let prefix = self . start_dir . components . len ( ) ;
256
- debug ! ( "Matching against %s " , self . id. short_name) ;
256
+ debug2 ! ( "Matching against {} " , self . id. short_name) ;
257
257
do os:: walk_dir ( & self . start_dir ) |pth| {
258
258
let maybe_known_crate_set = match pth. filename ( ) {
259
259
Some ( filename) if filter ( filename) => match filename {
@@ -282,7 +282,7 @@ impl PkgSrc {
282
282
cond. raise ( self . id . clone ( ) ) ;
283
283
}
284
284
285
- debug ! ( "In %s , found %u libs, %u mains, %u tests, %u benchs" ,
285
+ debug2 ! ( "In {} , found {} libs, {} mains, {} tests, {} benchs" ,
286
286
self . start_dir. to_str( ) ,
287
287
self . libs. len( ) ,
288
288
self . mains. len( ) ,
@@ -298,12 +298,12 @@ impl PkgSrc {
298
298
what : OutputType ) {
299
299
for crate in crates. iter( ) {
300
300
let path = self . start_dir . push_rel ( & crate . file) . normalize ( ) ;
301
- debug ! ( "build_crates: compiling %s " , path. to_str( ) ) ;
301
+ debug2 ! ( "build_crates: compiling {} " , path. to_str( ) ) ;
302
302
let path_str = path. to_str ( ) ;
303
303
let cfgs = crate . cfgs + cfgs;
304
304
305
305
do ctx. workcache_context . with_prep ( crate_tag ( & path) ) |prep| {
306
- debug ! ( "Building crate %s , declaring it as an input" , path. to_str( ) ) ;
306
+ debug2 ! ( "Building crate {} , declaring it as an input" , path. to_str( ) ) ;
307
307
prep. declare_input ( "file" , path. to_str ( ) ,
308
308
workcache_support:: digest_file_with_date ( & path) ) ;
309
309
let subpath = path. clone ( ) ;
@@ -323,7 +323,7 @@ impl PkgSrc {
323
323
subcfgs,
324
324
false ,
325
325
what) . to_str ( ) ;
326
- debug ! ( "Result of compiling %s was %s " , subpath_str, result) ;
326
+ debug2 ! ( "Result of compiling {} was {} " , subpath_str, result) ;
327
327
result
328
328
}
329
329
} ;
@@ -335,11 +335,11 @@ impl PkgSrc {
335
335
pub fn declare_inputs ( & self , prep : & mut workcache:: Prep ) {
336
336
let to_do = ~[ self . libs . clone ( ) , self . mains . clone ( ) ,
337
337
self . tests . clone ( ) , self . benchs . clone ( ) ] ;
338
- debug ! ( "In declare inputs, self = %s " , self . to_str( ) ) ;
338
+ debug2 ! ( "In declare inputs, self = {} " , self . to_str( ) ) ;
339
339
for cs in to_do. iter ( ) {
340
340
for c in cs. iter ( ) {
341
341
let path = self . start_dir . push_rel ( & c. file ) . normalize ( ) ;
342
- debug ! ( "Declaring input: %s " , path. to_str( ) ) ;
342
+ debug2 ! ( "Declaring input: {} " , path. to_str( ) ) ;
343
343
prep. declare_input ( "file" ,
344
344
path. to_str ( ) ,
345
345
workcache_support:: digest_file_with_date ( & path. clone ( ) ) ) ;
@@ -357,17 +357,17 @@ impl PkgSrc {
357
357
// Determine the destination workspace (which depends on whether
358
358
// we're using the rust_path_hack)
359
359
let destination_workspace = if is_workspace ( & self . workspace ) {
360
- debug ! ( "%s is indeed a workspace" , self . workspace. to_str( ) ) ;
360
+ debug2 ! ( "{} is indeed a workspace" , self . workspace. to_str( ) ) ;
361
361
self . workspace . clone ( )
362
362
} else {
363
363
// It would be nice to have only one place in the code that checks
364
364
// for the use_rust_path_hack flag...
365
365
if build_context. context . use_rust_path_hack {
366
366
let rs = default_workspace ( ) ;
367
- debug ! ( "Using hack: %s " , rs. to_str( ) ) ;
367
+ debug2 ! ( "Using hack: {} " , rs. to_str( ) ) ;
368
368
rs
369
369
} else {
370
- cond. raise ( fmt ! ( "Package root %s is not a workspace; pass in --rust_path_hack \
370
+ cond. raise ( format ! ( "Package root {} is not a workspace; pass in --rust_path_hack \
371
371
if you want to treat it as a package source",
372
372
self . workspace. to_str( ) ) )
373
373
}
@@ -377,14 +377,14 @@ impl PkgSrc {
377
377
let mains = self . mains . clone ( ) ;
378
378
let tests = self . tests . clone ( ) ;
379
379
let benchs = self . benchs . clone ( ) ;
380
- debug ! ( "Building libs in %s , destination = %s " ,
380
+ debug2 ! ( "Building libs in {} , destination = {} " ,
381
381
destination_workspace. to_str( ) , destination_workspace. to_str( ) ) ;
382
382
self . build_crates ( build_context, & destination_workspace, libs, cfgs, Lib ) ;
383
- debug ! ( "Building mains" ) ;
383
+ debug2 ! ( "Building mains" ) ;
384
384
self . build_crates ( build_context, & destination_workspace, mains, cfgs, Main ) ;
385
- debug ! ( "Building tests" ) ;
385
+ debug2 ! ( "Building tests" ) ;
386
386
self . build_crates ( build_context, & destination_workspace, tests, cfgs, Test ) ;
387
- debug ! ( "Building benches" ) ;
387
+ debug2 ! ( "Building benches" ) ;
388
388
self . build_crates ( build_context, & destination_workspace, benchs, cfgs, Bench ) ;
389
389
destination_workspace. to_str ( )
390
390
}
@@ -394,7 +394,7 @@ impl PkgSrc {
394
394
let crate_sets = [ & self . libs , & self . mains , & self . tests , & self . benchs ] ;
395
395
for crate_set in crate_sets. iter ( ) {
396
396
for c in crate_set. iter ( ) {
397
- debug ! ( "Built crate: %s " , c. file. to_str( ) )
397
+ debug2 ! ( "Built crate: {} " , c. file. to_str( ) )
398
398
}
399
399
}
400
400
}
0 commit comments