Skip to content

Commit

Permalink
cargo: syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Elly Jones committed Dec 21, 2011
1 parent 9834321 commit 2bdb0b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions src/cargo/cargo.rs
Expand Up @@ -559,7 +559,8 @@ fn sync_one(c: cargo, name: str, src: source) {
}
alt src.sig {
some(u) {
let p = run::program_output("curl", ["-f", "-s", "-o", sigfile, u]);
let p = run::program_output("curl", ["-f", "-s", "-o", sigfile,
u]);
if p.status != 0 {
warn(#fmt["fetch for source %s (sig %s) failed", name, u]);
}
Expand All @@ -568,7 +569,8 @@ fn sync_one(c: cargo, name: str, src: source) {
}
alt src.key {
some(u) {
let p = run::program_output("curl", ["-f", "-s", "-o", keyfile, u]);
let p = run::program_output("curl", ["-f", "-s", "-o", keyfile,
u]);
if p.status != 0 {
warn(#fmt["fetch for source %s (key %s) failed", name, u]);
}
Expand All @@ -580,7 +582,8 @@ fn sync_one(c: cargo, name: str, src: source) {
(some(_), some(_), some(f)) {
let r = pgp::verify(c.root, pkgfile, sigfile, f);
if !r {
warn(#fmt["signature verification failed for source %s", name]);
warn(#fmt["signature verification failed for source %s",
name]);
ret;
} else {
info(#fmt["signature ok for source %s", name]);
Expand All @@ -603,7 +606,7 @@ fn cmd_sync(c: cargo, argv: [str]) {
}
}

fn cmd_init(c: cargo, argv: [str]) {
fn cmd_init(c: cargo) {
let srcurl = "http://www.rust-lang.org/cargo/sources.json";
let sigurl = "http://www.rust-lang.org/cargo/sources.json.sig";

Expand Down Expand Up @@ -667,7 +670,7 @@ fn cmd_search(c: cargo, argv: [str]) {

fn cmd_usage() {
print("Usage: cargo <verb> [args...]");
print(" init Fetch default sources.json");
print(" init Fetch default sources");
print(" install [source/]package-name Install by name");
print(" install uuid:[source/]package-uuid Install by uuid");
print(" list [source] List packages");
Expand All @@ -683,7 +686,7 @@ fn main(argv: [str]) {
}
let c = configure();
alt argv[1] {
"init" { cmd_init(c, argv); }
"init" { cmd_init(c); }
"install" { cmd_install(c, argv); }
"list" { cmd_list(c, argv); }
"search" { cmd_search(c, argv); }
Expand Down
3 changes: 2 additions & 1 deletion src/cargo/pgp.rs
Expand Up @@ -91,7 +91,8 @@ fn add(root: str, key: str) {

fn verify(root: str, data: str, sig: str, keyfp: str) -> bool {
let path = fs::connect(root, "gpg");
let p = gpg(["--homedir", path, "--with-fingerprint", "--verify", sig, data]);
let p = gpg(["--homedir", path, "--with-fingerprint", "--verify", sig,
data]);
let res = "Primary key fingerprint: " + keyfp;
for line in str::split(p.err, '\n' as u8) {
if line == res {
Expand Down

0 comments on commit 2bdb0b6

Please sign in to comment.