Skip to content

Commit 24e4851

Browse files
committed
---
yaml --- r: 15286 b: refs/heads/try c: fabd49b h: refs/heads/master v: v3
1 parent 9ef8463 commit 24e4851

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 8dd22135a3733a9b518138ba115323bc0b69e111
5+
refs/heads/try: fabd49bc2d13d169f55916cc722d45651a0be50b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/cargo/cargo.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,13 @@ fn install_one_crate(c: cargo, path: str, cf: str) {
478478
(exec_suffix == "" && !str::starts_with(path::basename(ct),
479479
"lib")) {
480480
#debug(" bin: %s", ct);
481-
// FIXME: need libstd os::copy or something (Issue #1983)
482-
run::run_program("cp", [ct, c.bindir]);
481+
copy_warn(ct, c.bindir);
483482
if c.opts.mode == system_mode {
484483
install_one_crate_to_sysroot(ct, "bin");
485484
}
486485
} else {
487486
#debug(" lib: %s", ct);
488-
run::run_program("cp", [ct, c.libdir]);
487+
copy_warn(ct, c.bindir);
489488
if c.opts.mode == system_mode {
490489
install_one_crate_to_sysroot(ct, libdir());
491490
}
@@ -499,10 +498,7 @@ fn install_one_crate_to_sysroot(ct: str, target: str) {
499498
let path = [_path, "..", target];
500499
check vec::is_not_empty(path);
501500
let target_dir = path::normalize(path::connect_many(path));
502-
let p = run::program_output("cp", [ct, target_dir]);
503-
if p.status != 0 {
504-
warn(#fmt["Copying %s to %s is failed", ct, target_dir]);
505-
}
501+
copy_warn(ct, target_dir);
506502
}
507503
none { }
508504
}
@@ -772,7 +768,7 @@ fn sync_one(c: cargo, name: str, src: source) {
772768
info(#fmt["no signature for source %s", name]);
773769
}
774770
}
775-
run::run_program("cp", [pkgfile, destpkgfile]);
771+
copy_warn(pkgfile, destpkgfile);
776772
}
777773

778774
fn cmd_sync(c: cargo) {
@@ -812,7 +808,7 @@ fn cmd_init(c: cargo) {
812808
} else {
813809
info(#fmt["signature ok for sources.json"]);
814810
}
815-
run::run_program("cp", [srcfile, destsrcfile]);
811+
copy_warn(srcfile, destsrcfile);
816812

817813
info(#fmt["Initialized .cargo in %s", c.root]);
818814
}
@@ -853,6 +849,12 @@ fn cmd_search(c: cargo) {
853849
info(#fmt["Found %d packages.", n]);
854850
}
855851

852+
fn copy_warn(src: str, dest: str) {
853+
if !os::copy_file(src, dest) {
854+
warn(#fmt["Copying %s to %s failed", src, dest]);
855+
}
856+
}
857+
856858
fn cmd_usage() {
857859
print("Usage: cargo <verb> [options] [args...]" +
858860
"

0 commit comments

Comments
 (0)