@@ -295,7 +295,7 @@ pub fn load_link(mis: ~[@ast::meta_item]) -> (Option<~str>,
295295 _ => { }
296296 }
297297 }
298- _ => die !(~"load_link: meta items must be name-values")
298+ _ => fail !(~"load_link: meta items must be name-values")
299299 }
300300 }
301301 (name, vers, uuid)
@@ -332,7 +332,7 @@ pub fn load_crate(filename: &Path) -> Option<Crate> {
332332 }
333333 }
334334 _ => {
335- die !(~"crate attributes may not contain " +
335+ fail !(~"crate attributes may not contain " +
336336 ~"meta_words");
337337 }
338338 }
@@ -435,7 +435,7 @@ pub fn rest(s: ~str, start: uint) -> ~str {
435435pub fn need_dir(s: &Path) {
436436 if os::path_is_dir(s) { return; }
437437 if !os::make_dir(s, 493_i32 /* oct: 755 */) {
438- die !(fmt!("can't make_dir %s", s.to_str()));
438+ fail !(fmt!("can't make_dir %s", s.to_str()));
439439 }
440440}
441441
@@ -453,14 +453,14 @@ pub fn valid_pkg_name(s: &str) -> bool {
453453
454454pub fn parse_source(name: ~str, j: &json::Json) -> @Source {
455455 if !valid_pkg_name(name) {
456- die !(fmt!("'%s' is an invalid source name", name));
456+ fail !(fmt!("'%s' is an invalid source name", name));
457457 }
458458
459459 match *j {
460460 json::Object(ref j) => {
461461 let mut url = match j.find(&~"url") {
462462 Some(&json::String(u)) => copy u,
463- _ => die !(~"needed 'url' field in source")
463+ _ => fail !(~"needed 'url' field in source")
464464 };
465465 let method = match j.find(&~"method") {
466466 Some(&json::String(u)) => copy u,
@@ -485,7 +485,7 @@ pub fn parse_source(name: ~str, j: &json::Json) -> @Source {
485485 mut keyfp: keyfp,
486486 packages: DVec() };
487487 }
488- _ => die !(~"needed dict value in source")
488+ _ => fail !(~"needed dict value in source")
489489 };
490490}
491491
@@ -500,8 +500,8 @@ pub fn try_parse_sources(filename: &Path,
500500 debug!("source: %s", *k);
501501 }
502502 }
503- Ok(_) => die !(~"malformed sources.json"),
504- Err(e) => die !(fmt!("%s:%s", filename.to_str(), e.to_str()))
503+ Ok(_) => fail !(~"malformed sources.json"),
504+ Err(e) => fail !(fmt!("%s:%s", filename.to_str(), e.to_str()))
505505 }
506506}
507507
@@ -662,7 +662,7 @@ pub fn build_cargo_options(argv: ~[~str]) -> Options {
662662 let matches = &match getopts::getopts(argv, opts()) {
663663 result::Ok(m) => m,
664664 result::Err(f) => {
665- die !(fmt!("%s", getopts::fail_str(f)));
665+ fail !(fmt!("%s", getopts::fail_str(f)));
666666 }
667667 };
668668
@@ -675,10 +675,10 @@ pub fn build_cargo_options(argv: ~[~str]) -> Options {
675675 let is_install = len > 1u && matches.free[1] == ~"install";
676676 let is_uninstall = len > 1u && matches.free[1] == ~"uninstall";
677677
678- if G && g { die !(~"-G and -g both provided"); }
678+ if G && g { fail !(~"-G and -g both provided"); }
679679
680680 if !is_install && !is_uninstall && (g || G) {
681- die !(~"-g and -G are only valid for `install` and `uninstall|rm`");
681+ fail !(~"-g and -G are only valid for `install` and `uninstall|rm`");
682682 }
683683
684684 let mode =
@@ -845,7 +845,7 @@ pub fn install_source(c: &mut Cargo, path: &Path) {
845845 }
846846
847847 if vec::is_empty(cratefiles) {
848- die !(~"this doesn't look like a rust package (no .rc files)");
848+ fail !(~"this doesn't look like a rust package (no .rc files)");
849849 }
850850
851851 for cratefiles.each |cf| {
@@ -889,7 +889,7 @@ pub fn install_curl(c: &mut Cargo, wd: &Path, url: ~str) {
889889 let p = run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o",
890890 tarpath.to_str(), url]);
891891 if p.status != 0 {
892- die !(fmt!("fetch of %s failed: %s", url, p.err));
892+ fail !(fmt!("fetch of %s failed: %s", url, p.err));
893893 }
894894 run::run_program(~"tar", ~[~"-x", ~"--strip-components=1",
895895 ~"-C", wd.to_str(),
@@ -1123,7 +1123,7 @@ pub fn install_query(c: &mut Cargo, wd: &Path, target: ~str) {
11231123pub fn get_temp_workdir(c: &Cargo) -> Path {
11241124 match tempfile::mkdtemp(&c.workdir, "cargo") {
11251125 Some(wd) => wd,
1126- None => die !(fmt!("needed temp dir: %s",
1126+ None => fail !(fmt!("needed temp dir: %s",
11271127 c.workdir.to_str()))
11281128 }
11291129}
@@ -1138,7 +1138,7 @@ pub fn cmd_install(c: &mut Cargo) {
11381138 wd.to_str()]);
11391139
11401140 if status != 0 {
1141- die !(fmt!("could not copy directory: %s", cwd.to_str()));
1141+ fail !(fmt!("could not copy directory: %s", cwd.to_str()));
11421142 }
11431143
11441144 install_source(c, &wd);
0 commit comments