@@ -268,12 +268,12 @@ fn output_file_name(workspace: &Path, short_name: &str) -> Path {
268
268
workspace. push ( fmt ! ( "%s%s" , short_name, os:: EXE_SUFFIX ) )
269
269
}
270
270
271
- fn touch_source_file ( workspace : & Path , short_name : & str ) {
271
+ fn touch_source_file ( workspace : & Path , pkgid : & PkgId ) {
272
272
use conditions:: bad_path:: cond;
273
- let pkg_src_dir = workspace. push ( "src" ) . push ( short_name ) ;
274
- let contents = os:: list_dir ( & pkg_src_dir) ;
273
+ let pkg_src_dir = workspace. push ( "src" ) . push ( pkgid . to_str ( ) ) ;
274
+ let contents = os:: list_dir_path ( & pkg_src_dir) ;
275
275
for contents. iter( ) . advance |p| {
276
- if Path ( copy * p ) . filetype( ) == Some ( ~". rs") {
276
+ if p . filetype( ) == Some ( ~". rs") {
277
277
// should be able to do this w/o a process
278
278
if run:: process_output ( "touch" , [ p. to_str ( ) ] ) . status != 0 {
279
279
let _ = cond. raise ( ( copy pkg_src_dir, ~"Bad path") ) ;
@@ -287,20 +287,19 @@ fn touch_source_file(workspace: &Path, short_name: &str) {
287
287
fn frob_source_file ( workspace : & Path , pkgid : & PkgId ) {
288
288
use conditions:: bad_path:: cond;
289
289
let pkg_src_dir = workspace. push ( "src" ) . push ( pkgid. to_str ( ) ) ;
290
- let contents = os:: list_dir ( & pkg_src_dir) ;
290
+ let contents = os:: list_dir_path ( & pkg_src_dir) ;
291
291
let mut maybe_p = None ;
292
292
for contents. iter( ) . advance |p| {
293
- if Path ( copy * p ) . filetype( ) == Some ( ~". rs") {
293
+ if p . filetype( ) == Some ( ~". rs") {
294
294
maybe_p = Some ( p) ;
295
295
break ;
296
296
}
297
297
}
298
298
match maybe_p {
299
299
Some ( p) => {
300
- let p = Path ( copy * p) ;
301
- let w = io:: buffered_file_writer ( & p) ;
300
+ let w = io:: file_writer ( * p, & [ io:: Append ] ) ;
302
301
match w {
303
- Err ( s) => { let _ = cond. raise ( ( p, fmt ! ( "Bad path: %s" , s) ) ) ; }
302
+ Err ( s) => { let _ = cond. raise ( ( copy * * p, fmt ! ( "Bad path: %s" , s) ) ) ; }
304
303
Ok ( w) => w. write_line ( "" )
305
304
}
306
305
}
@@ -615,7 +614,7 @@ fn do_rebuild_dep_dates_change() {
615
614
let workspace = create_local_package_with_dep(&p_id, &dep_id);
616
615
command_line_test([~" build", ~" foo"], &workspace);
617
616
let bar_date = datestamp(&lib_output_file_name(&workspace, " build", " bar"));
618
- touch_source_file(&workspace, " bar " );
617
+ touch_source_file(&workspace, &dep_id );
619
618
command_line_test([~" build", ~" foo"], &workspace);
620
619
let new_bar_date = datestamp(&lib_output_file_name(&workspace, " build", " bar"));
621
620
assert!(new_bar_date > bar_date);
0 commit comments