Skip to content

Commit c479411

Browse files
committed
---
yaml --- r: 58811 b: refs/heads/incoming c: 5fb5a94 h: refs/heads/master i: 58809: 8509c35 58807: a23a1a0 v: v3
1 parent 7dd280a commit c479411

File tree

15 files changed

+135
-430
lines changed

15 files changed

+135
-430
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: c42f1218a0a7b3a5c84502f9cb4b123d65148f4c
9+
refs/heads/incoming: 5fb5a94118399e50c50f25586266c317ee5ba69b
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/os.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -772,28 +772,6 @@ pub fn list_dir_path(p: &Path) -> ~[~Path] {
772772
list_dir(p).map(|f| ~p.push(*f))
773773
}
774774
775-
/// Removes a directory at the specified path, after removing
776-
/// all its contents. Use carefully!
777-
pub fn remove_dir_recursive(p: &Path) -> bool {
778-
let mut error_happened = false;
779-
for walk_dir(p) |inner| {
780-
if !error_happened {
781-
if path_is_dir(inner) {
782-
if !remove_dir_recursive(inner) {
783-
error_happened = true;
784-
}
785-
}
786-
else {
787-
if !remove_file(inner) {
788-
error_happened = true;
789-
}
790-
}
791-
}
792-
};
793-
// Directory should now be empty
794-
!error_happened && remove_dir(p)
795-
}
796-
797775
/// Removes a directory at the specified path
798776
pub fn remove_dir(p: &Path) -> bool {
799777
return rmdir(p);
@@ -899,10 +877,6 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
899877
if istream as uint == 0u {
900878
return false;
901879
}
902-
// Preserve permissions
903-
let from_mode = from.get_mode().expect("copy_file: couldn't get permissions \
904-
for source file");
905-
906880
let ostream = do as_c_charp(to.to_str()) |top| {
907881
do as_c_charp("w+b") |modebuf| {
908882
libc::fopen(top, modebuf)
@@ -934,15 +908,6 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
934908
}
935909
fclose(istream);
936910
fclose(ostream);
937-
938-
// Give the new file the old file's permissions
939-
unsafe {
940-
if do str::as_c_str(to.to_str()) |to_buf| {
941-
libc::chmod(to_buf, from_mode as mode_t)
942-
} != 0 {
943-
return false; // should be a condition...
944-
}
945-
}
946911
return ok;
947912
}
948913
}
@@ -1629,15 +1594,13 @@ mod tests {
16291594
== buf.len() as size_t))
16301595
}
16311596
assert!((libc::fclose(ostream) == (0u as c_int)));
1632-
let in_mode = in.get_mode();
16331597
let rs = os::copy_file(&in, &out);
16341598
if (!os::path_exists(&in)) {
16351599
fail!(fmt!("%s doesn't exist", in.to_str()));
16361600
}
16371601
assert!((rs));
16381602
let rslt = run::run_program(~"diff", ~[in.to_str(), out.to_str()]);
16391603
assert!((rslt == 0));
1640-
assert!(out.get_mode() == in_mode);
16411604
assert!((remove_file(&in)));
16421605
assert!((remove_file(&out)));
16431606
}

branches/incoming/src/libcore/task/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use result::Result;
3939
use comm::{stream, Chan, GenericChan, GenericPort, Port};
4040
use prelude::*;
4141
use result;
42-
use task::rt::{task_id, sched_id, rust_task};
42+
use task::rt::{task_id, sched_id};
4343
use util;
4444
use util::replace;
4545
use unstable::finally::Finally;

branches/incoming/src/libcore/unstable/lang.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ use str;
1717
use sys;
1818
use unstable::exchange_alloc;
1919
use cast::transmute;
20+
#[cfg(not(stage0))]
2021
use rt::{context, OldTaskContext};
22+
#[cfg(not(stage0))]
2123
use rt::local_services::borrow_local_services;
2224

2325
#[allow(non_camel_case_types)]

branches/incoming/src/librustc/back/rpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn get_rpath_flags(sess: session::Session, out_filename: &Path)
4040
// where rustrt is and we know every rust program needs it
4141
let libs = vec::append_one(libs, get_sysroot_absolute_rt_lib(sess));
4242

43-
let rpaths = get_rpaths(os, sysroot, output, libs,
43+
let rpaths = get_rpaths(os, &sysroot, output, libs,
4444
sess.opts.target_triple);
4545
rpaths_to_flags(rpaths)
4646
}

branches/incoming/src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ pub fn build_session_options(binary: @~str,
603603
link::output_type_bitcode
604604
} else { link::output_type_exe };
605605
let sysroot_opt = getopts::opt_maybe_str(matches, ~"sysroot");
606-
let sysroot_opt = sysroot_opt.map(|m| @Path(*m));
606+
let sysroot_opt = sysroot_opt.map(|m| Path(*m));
607607
let target_opt = getopts::opt_maybe_str(matches, ~"target");
608608
let target_feature_opt = getopts::opt_maybe_str(matches, ~"target-feature");
609609
let save_temps = getopts::opt_present(matches, ~"save-temps");

branches/incoming/src/librustc/driver/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub struct options {
125125
output_type: back::link::output_type,
126126
addl_lib_search_paths: ~[Path],
127127
linker_args: ~[~str],
128-
maybe_sysroot: Option<@Path>,
128+
maybe_sysroot: Option<Path>,
129129
target_triple: ~str,
130130
target_feature: ~str,
131131
// User-specified cfg meta items. The compiler itself will add additional

branches/incoming/src/librustc/metadata/filesearch.rs

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,41 @@ pub fn pick_file(file: Path, path: &Path) -> Option<Path> {
2020
}
2121

2222
pub trait FileSearch {
23-
fn sysroot(&self) -> @Path;
24-
fn for_each_lib_search_path(&self, f: &fn(&Path) -> bool);
23+
fn sysroot(&self) -> Path;
24+
fn lib_search_paths(&self) -> ~[Path];
2525
fn get_target_lib_path(&self) -> Path;
2626
fn get_target_lib_file_path(&self, file: &Path) -> Path;
2727
}
2828

29-
pub fn mk_filesearch(maybe_sysroot: &Option<@Path>,
29+
pub fn mk_filesearch(maybe_sysroot: &Option<Path>,
3030
target_triple: &str,
3131
addl_lib_search_paths: ~[Path])
3232
-> @FileSearch {
3333
struct FileSearchImpl {
34-
sysroot: @Path,
34+
sysroot: Path,
3535
addl_lib_search_paths: ~[Path],
3636
target_triple: ~str
3737
}
3838
impl FileSearch for FileSearchImpl {
39-
fn sysroot(&self) -> @Path { self.sysroot }
40-
fn for_each_lib_search_path(&self, f: &fn(&Path) -> bool) {
41-
debug!("filesearch: searching additional lib search paths");
42-
if !self.addl_lib_search_paths.each(f) {
43-
return;
39+
fn sysroot(&self) -> Path { /*bad*/copy self.sysroot }
40+
fn lib_search_paths(&self) -> ~[Path] {
41+
let mut paths = /*bad*/copy self.addl_lib_search_paths;
42+
43+
paths.push(
44+
make_target_lib_path(&self.sysroot,
45+
self.target_triple));
46+
match get_rustpkg_lib_path_nearest() {
47+
result::Ok(ref p) => paths.push((/*bad*/copy *p)),
48+
result::Err(_) => ()
4449
}
45-
46-
debug!("filesearch: searching target lib path");
47-
if !f(&make_target_lib_path(self.sysroot,
48-
self.target_triple)) {
49-
return;
50+
match get_rustpkg_lib_path() {
51+
result::Ok(ref p) => paths.push((/*bad*/copy *p)),
52+
result::Err(_) => ()
5053
}
51-
debug!("filesearch: searching rustpkg lib path nearest");
52-
if match get_rustpkg_lib_path_nearest() {
53-
result::Ok(ref p) => f(p),
54-
result::Err(_) => true
55-
} {
56-
return;
57-
}
58-
debug!("filesearch: searching rustpkg lib path");
59-
match get_rustpkg_lib_path() {
60-
result::Ok(ref p) => f(p),
61-
result::Err(_) => true
62-
}
54+
paths
6355
}
6456
fn get_target_lib_path(&self) -> Path {
65-
make_target_lib_path(self.sysroot, self.target_triple)
57+
make_target_lib_path(&self.sysroot, self.target_triple)
6658
}
6759
fn get_target_lib_file_path(&self, file: &Path) -> Path {
6860
self.get_target_lib_path().push_rel(file)
@@ -80,7 +72,7 @@ pub fn mk_filesearch(maybe_sysroot: &Option<@Path>,
8072

8173
pub fn search<T:Copy>(filesearch: @FileSearch, pick: pick<T>) -> Option<T> {
8274
let mut rslt = None;
83-
for filesearch.for_each_lib_search_path() |lib_search_path| {
75+
for filesearch.lib_search_paths().each |lib_search_path| {
8476
debug!("searching %s", lib_search_path.to_str());
8577
for os::list_dir_path(lib_search_path).each |path| {
8678
debug!("testing %s", path.to_str());
@@ -116,10 +108,10 @@ fn get_or_default_sysroot() -> Path {
116108
}
117109
}
118110
119-
fn get_sysroot(maybe_sysroot: &Option<@Path>) -> @Path {
111+
fn get_sysroot(maybe_sysroot: &Option<Path>) -> Path {
120112
match *maybe_sysroot {
121-
option::Some(sr) => sr,
122-
option::None => @get_or_default_sysroot()
113+
option::Some(ref sr) => (/*bad*/copy *sr),
114+
option::None => get_or_default_sysroot()
123115
}
124116
}
125117

branches/incoming/src/librustpkg/conditions.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,5 @@ condition! {
1818
}
1919

2020
condition! {
21-
nonexistent_package: (super::PkgId, ~str) -> ();
22-
}
23-
24-
condition! {
25-
copy_failed: (super::Path, super::Path) -> ();
26-
}
27-
28-
condition! {
29-
missing_pkg_files: (super::PkgId) -> ();
21+
nonexistent_package: (super::PkgId, ~str) -> super::Path;
3022
}

branches/incoming/src/librustpkg/context.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
use core::hashmap::HashMap;
1414

1515
pub struct Ctx {
16-
// Sysroot -- if this is None, uses rustc filesearch's
17-
// idea of the default
18-
sysroot_opt: Option<@Path>,
1916
// I'm not sure what this is for
2017
json: bool,
2118
// Cache of hashes of things already installed

0 commit comments

Comments
 (0)