diff options
Diffstat (limited to 'src/librustpkg/path_util.rs')
| -rw-r--r-- | src/librustpkg/path_util.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs index e4a345733ea..a2cae3ab20e 100644 --- a/src/librustpkg/path_util.rs +++ b/src/librustpkg/path_util.rs @@ -55,7 +55,7 @@ pub fn rust_path() -> ~[Path] { let cwd = os::getcwd(); // now add in default entries env_rust_path.push(cwd.push(".rust")); - env_rust_path.push(copy cwd); + env_rust_path.push(cwd.clone()); do cwd.each_parent() |p| { push_if_exists(&mut env_rust_path, p) }; let h = os::homedir(); for h.iter().advance |h| { push_if_exists(&mut env_rust_path, h); } @@ -94,7 +94,7 @@ pub fn workspace_contains_package_id(pkgid: &PkgId, workspace: &Path) -> bool { let src_dir = workspace.push("src"); let dirs = os::list_dir(&src_dir); for dirs.iter().advance |p| { - let p = Path(copy *p); + let p = Path((*p).clone()); debug!("=> p = %s", p.to_str()); if !os::path_is_dir(&src_dir.push_rel(&p)) { loop; @@ -107,7 +107,7 @@ pub fn workspace_contains_package_id(pkgid: &PkgId, workspace: &Path) -> bool { else { let pf = p.filename(); for pf.iter().advance |pf| { - let f_ = copy *pf; + let f_ = (*pf).clone(); let g = f_.to_str(); match split_version_general(g, '-') { Some((ref might_match, ref vers)) => { @@ -145,7 +145,7 @@ pub fn first_pkgid_src_in_workspace(pkgid: &PkgId, workspace: &Path) -> Option<P let rs = pkgid_src_in_workspace(pkgid, workspace); for rs.iter().advance |p| { if os::path_exists(p) { - return Some(copy *p); + return Some((*p).clone()); } } None @@ -242,7 +242,7 @@ pub fn library_in_workspace(path: &LocalPath, short_name: &str, where: Target, for dir_contents.iter().advance |p| { let mut which = 0; let mut hash = None; - let p_path = Path(copy *p); + let p_path = Path((*p).clone()); let extension = p_path.filetype(); debug!("p = %s, p's extension is %?", p.to_str(), extension); match extension { @@ -308,7 +308,7 @@ pub fn target_executable_in_workspace(pkgid: &PkgId, workspace: &Path) -> Path { pub fn target_library_in_workspace(pkgid: &PkgId, workspace: &Path) -> Path { use conditions::bad_path::cond; if !os::path_is_dir(workspace) { - cond.raise((copy *workspace, + cond.raise(((*workspace).clone(), fmt!("Workspace supplied to target_library_in_workspace \ is not a directory! %s", workspace.to_str()))); } @@ -341,7 +341,7 @@ fn target_file_in_workspace(pkgid: &PkgId, workspace: &Path, }; let result = workspace.push(subdir); if !os::path_exists(&result) && !mkdir_recursive(&result, U_RWX) { - cond.raise((copy result, fmt!("target_file_in_workspace couldn't \ + cond.raise((result.clone(), fmt!("target_file_in_workspace couldn't \ create the %s dir (pkgid=%s, workspace=%s, what=%?, where=%?", subdir, pkgid.to_str(), workspace.to_str(), what, where))); } @@ -375,12 +375,15 @@ pub fn mk_output_path(what: OutputType, where: Target, // the executable blat-0.5 to live under blat/ let dir = match where { // If we're installing, it just goes under <workspace>... - Install => copy *workspace, // bad copy, but I just couldn't make the borrow checker happy + Install => { + // bad copy, but I just couldn't make the borrow checker happy + (*workspace).clone() + } // and if we're just building, it goes in a package-specific subdir Build => workspace.push_rel(&*pkg_id.local_path) }; debug!("[%?:%?] mk_output_path: short_name = %s, path = %s", what, where, - if what == Lib { copy short_name_with_version } else { copy pkg_id.short_name }, + if what == Lib { short_name_with_version.clone() } else { pkg_id.short_name.clone() }, dir.to_str()); let mut output_path = match what { // this code is duplicated from elsewhere; fix this |
