Skip to content

Commit ce24ce1

Browse files
committed
Merge pull request #1307 from elly/cargo
cargo: detect library installs properly
2 parents aa3d58c + a87d80f commit ce24ce1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cargo/cargo.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,13 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
154154
name = str::slice(name, 0u, ri as uint);
155155
}
156156
log #fmt["Installing: %s", name];
157-
let old = fs::list_dir(".");
158-
run::run_program("rustc", [cf]);
159-
let new = fs::list_dir(".");
157+
let old = vec::map({|x| str::slice(x, 2u, str::byte_len(x))}, fs::list_dir("."));
158+
run::run_program("rustc", [name + ".rc"]);
159+
let new = vec::map({|x| str::slice(x, 2u, str::byte_len(x))}, fs::list_dir("."));
160160
let created = vec::filter::<str>({ |n| !vec::member::<str>(n, old) }, new);
161161
for ct: str in created {
162-
if str::ends_with(ct, os::exec_suffix()) {
162+
if (os::exec_suffix() != "" && str::ends_with(ct, os::exec_suffix())) ||
163+
(os::exec_suffix() == "" && !str::starts_with(ct, "lib")) {
163164
log #fmt[" bin: %s", ct];
164165
// FIXME: need libstd fs::copy or something
165166
run::run_program("cp", [ct, c.bindir]);

0 commit comments

Comments
 (0)