diff --git a/Makefile b/Makefile index c140a7e04..121a63221 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,7 @@ clean: $(addprefix clean_,$(EXES)) $(RM) -rf build tmp build: + git submodule update --init mkdir build tmp: diff --git a/base64/base64.rs b/base64/base64.rs index c07cecbcb..d18d4ef4a 100644 --- a/base64/base64.rs +++ b/base64/base64.rs @@ -1,4 +1,4 @@ -#[crate_id(name="base64", vers="1.0.0", author="Jordy Dickinson")]; +#![crate_id(name="base64", vers="1.0.0", author="Jordy Dickinson")] /* * This file is part of the uutils coreutils package. @@ -9,8 +9,8 @@ * that was distributed with this source code. */ -#[feature(phase)]; -#[feature(macro_rules)]; +#![feature(phase)] +#![feature(macro_rules)] extern crate serialize; extern crate getopts; @@ -100,10 +100,10 @@ fn decode(input: &mut Reader, ignore_garbage: bool) { to_decode = str::replace(to_decode, "\n", ""); if ignore_garbage { - let standard_chars = + let standard_chars: ~[char] = bytes!("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz", - "0123456789+/").map(|b| char::from_u32(*b as u32).unwrap()); + "0123456789+/").iter().map(|b| char::from_u32(*b as u32).unwrap()).collect(); to_decode = to_decode .trim_chars(&|c| !standard_chars.contains(&c)) diff --git a/basename/basename.rs b/basename/basename.rs index fb1f12c6e..e7af6ada6 100644 --- a/basename/basename.rs +++ b/basename/basename.rs @@ -1,5 +1,5 @@ -#[feature(macro_rules)]; -#[crate_id(name="basename", vers="1.0.0", author="Jimmy Lu")]; +#![feature(macro_rules)] +#![crate_id(name="basename", vers="1.0.0", author="Jimmy Lu")] /* * This file is part of the uutils coreutils package. diff --git a/cat/cat.rs b/cat/cat.rs index f347f3f39..c79472631 100644 --- a/cat/cat.rs +++ b/cat/cat.rs @@ -1,5 +1,5 @@ -#[crate_id(name="cat", vers="1.0.0", author="Seldaek")]; -#[feature(managed_boxes)]; +#![crate_id(name="cat", vers="1.0.0", author="Seldaek")] +#![feature(managed_boxes)] /* * This file is part of the uutils coreutils package. diff --git a/common/c_types.rs b/common/c_types.rs index 3cb2ae895..b27d6741d 100644 --- a/common/c_types.rs +++ b/common/c_types.rs @@ -1,4 +1,4 @@ -#[allow(dead_code, non_camel_case_types)]; +#![allow(dead_code, non_camel_case_types)] extern crate getopts; diff --git a/common/util.rs b/common/util.rs index db506e3be..9bd9bb5ae 100644 --- a/common/util.rs +++ b/common/util.rs @@ -7,7 +7,7 @@ * file that was distributed with this source code. */ -#[macro_escape]; +#![macro_escape] #[macro_export] macro_rules! show_error( diff --git a/common/utmpx.rs b/common/utmpx.rs index 67ca85de8..9d3392e75 100644 --- a/common/utmpx.rs +++ b/common/utmpx.rs @@ -1,5 +1,5 @@ -#[allow(non_camel_case_types)]; -#[allow(dead_code)]; +#![allow(non_camel_case_types)] +#![allow(dead_code)] pub use self::utmpx::{DEFAULT_FILE,USER_PROCESS,BOOT_TIME,c_utmp}; #[cfg(target_os = "linux")] diff --git a/dirname/dirname.rs b/dirname/dirname.rs index f475b23a4..c1f6439b0 100644 --- a/dirname/dirname.rs +++ b/dirname/dirname.rs @@ -1,4 +1,4 @@ -#[crate_id(name="dirname", vers="1.0.0", author="Derek Chiang")]; +#![crate_id(name="dirname", vers="1.0.0", author="Derek Chiang")] /* * This file is part of the uutils coreutils package. diff --git a/du/du.rs b/du/du.rs index 7e6f2094c..44af7b497 100644 --- a/du/du.rs +++ b/du/du.rs @@ -1,4 +1,4 @@ -#[crate_id(name="du", vers="1.0.0", author="Derek Chiang")]; +#![crate_id(name="du", vers="1.0.0", author="Derek Chiang")] /* * This file is part of the uutils coreutils package. @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ -#[allow(uppercase_variables)]; -#[feature(macro_rules)]; +#![allow(uppercase_variables)] +#![feature(macro_rules)] extern crate getopts; extern crate sync; @@ -47,8 +47,8 @@ fn du(path: &Path, mut my_stat: FileStat, let read = match fs::readdir(path) { Ok(read) => read, Err(e) => { - writeln!(&mut stderr(), "{}: cannot read directory ‘{}‘: {}", - options.program_name, path.display(), e); + safe_writeln!(&mut stderr(), "{}: cannot read directory ‘{}‘: {}", + options.program_name, path.display(), e); return ~[Arc::new(my_stat)] } }; diff --git a/echo/echo.rs b/echo/echo.rs index 38a31a9b2..84f3cf76f 100644 --- a/echo/echo.rs +++ b/echo/echo.rs @@ -1,5 +1,5 @@ -#[feature(macro_rules)]; -#[crate_id(name="echo", vers="1.0.0", author="Derek Chiang")]; +#![feature(macro_rules)] +#![crate_id(name="echo", vers="1.0.0", author="Derek Chiang")] /* * This file is part of the uutils coreutils package. diff --git a/env/env.rs b/env/env.rs index f74f80db2..7f4dfdf57 100644 --- a/env/env.rs +++ b/env/env.rs @@ -1,4 +1,4 @@ -#[crate_id(name="env", vers="1.0.0", author="LeoTestard")]; +#![crate_id(name="env", vers="1.0.0", author="LeoTestard")] /* * This file is part of the uutils coreutils package. @@ -11,7 +11,7 @@ /* last synced with: env (GNU coreutils) 8.13 */ -#[allow(non_camel_case_types)]; +#![allow(non_camel_case_types)] struct options { ignore_env: bool, diff --git a/false/false.rs b/false/false.rs index 9243cc272..8d7253899 100644 --- a/false/false.rs +++ b/false/false.rs @@ -1,4 +1,4 @@ -#[crate_id(name="false", vers="1.0.0", author="Seldaek")]; +#![crate_id(name="false", vers="1.0.0", author="Seldaek")] /* * This file is part of the uutils coreutils package. diff --git a/fold/fold.rs b/fold/fold.rs index 5fe597fd4..adef2288e 100644 --- a/fold/fold.rs +++ b/fold/fold.rs @@ -1,4 +1,4 @@ -#[crate_id(name = "fold", vers = "1.0.0", author = "Arcterus")]; +#![crate_id(name = "fold", vers = "1.0.0", author = "Arcterus")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/groups/groups.rs b/groups/groups.rs index 922cbcb9a..d46ac19d1 100644 --- a/groups/groups.rs +++ b/groups/groups.rs @@ -1,4 +1,4 @@ -#[crate_id(name="groups", vers="1.0.0", author="Alan Andrade")]; +#![crate_id(name="groups", vers="1.0.0", author="Alan Andrade")] /* * This file is part of the uutils coreutils package. * @@ -8,7 +8,7 @@ * file that was distributed with this source code. * */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/head/head.rs b/head/head.rs index b5ac881de..9b864958e 100644 --- a/head/head.rs +++ b/head/head.rs @@ -1,4 +1,4 @@ -#[crate_id(name="head", vers="1.0.0", author="Alan Andrade")]; +#![crate_id(name="head", vers="1.0.0", author="Alan Andrade")] /* * This file is part of the uutils coreutils package. * diff --git a/hostname/hostname.rs b/hostname/hostname.rs index b286a99fa..3fe1785d4 100644 --- a/hostname/hostname.rs +++ b/hostname/hostname.rs @@ -1,4 +1,4 @@ -#[crate_id(name="hostname", vers="1.0.0", author="Alan Andrade")]; +#![crate_id(name="hostname", vers="1.0.0", author="Alan Andrade")] /* * This file is part of the uutils coreutils package. * diff --git a/id/id.rs b/id/id.rs index a6aa1c080..480007129 100644 --- a/id/id.rs +++ b/id/id.rs @@ -1,4 +1,4 @@ -#[crate_id(name="id", version="1.0.0", author="Alan Andrade")]; +#![crate_id(name="id", version="1.0.0", author="Alan Andrade")] /* * This file is part of the uutils coreutils package. @@ -13,8 +13,8 @@ * http://www.opensource.apple.com/source/shell_cmds/shell_cmds-118/id/id.c */ -#[allow(non_camel_case_types)]; -#[feature(macro_rules)]; +#![allow(non_camel_case_types)] +#![feature(macro_rules)] extern crate getopts; use std::{libc, os}; diff --git a/logname/logname.rs b/logname/logname.rs index cce4334f3..8aed0c719 100644 --- a/logname/logname.rs +++ b/logname/logname.rs @@ -1,4 +1,4 @@ -#[crate_id(name="logname", version="1.0.0", author="Benoit Benedetti")]; +#![crate_id(name="logname", version="1.0.0", author="Benoit Benedetti")] /* * This file is part of the uutils coreutils package. @@ -11,9 +11,9 @@ /* last synced with: logname (GNU coreutils) 8.22 */ -#[allow(non_camel_case_types)]; +#![allow(non_camel_case_types)] -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/md5sum/md5sum.rs b/md5sum/md5sum.rs index 1c0b69b95..1b4e1294c 100644 --- a/md5sum/md5sum.rs +++ b/md5sum/md5sum.rs @@ -1,4 +1,4 @@ -#[crate_id(name = "md5sum", vers = "1.0.0", author = "Arcterus")]; +#![crate_id(name = "md5sum", vers = "1.0.0", author = "Arcterus")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate crypto = "rust-crypto"; extern crate getopts; diff --git a/mkdir/mkdir.rs b/mkdir/mkdir.rs index a622b373c..41bce3ca6 100644 --- a/mkdir/mkdir.rs +++ b/mkdir/mkdir.rs @@ -1,4 +1,4 @@ -#[crate_id(name="mkdir", vers="1.0.0", author="Nicholas Juszczak")]; +#![crate_id(name="mkdir", vers="1.0.0", author="Nicholas Juszczak")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/paste/paste.rs b/paste/paste.rs index 15e69df9d..bc6338e82 100644 --- a/paste/paste.rs +++ b/paste/paste.rs @@ -1,4 +1,4 @@ -#[crate_id(name = "paste", vers = "1.0.0", author = "Arcterus")]; +#![crate_id(name = "paste", vers = "1.0.0", author = "Arcterus")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/printenv/printenv.rs b/printenv/printenv.rs index 235ec1f3a..e062ac4c6 100644 --- a/printenv/printenv.rs +++ b/printenv/printenv.rs @@ -1,4 +1,4 @@ -#[crate_id(name="printenv", vers="1.0.0", author="Seldaek")]; +#![crate_id(name="printenv", vers="1.0.0", author="Seldaek")] /* * This file is part of the uutils coreutils package. @@ -11,7 +11,7 @@ /* last synced with: printenv (GNU coreutils) 8.13 */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/pwd/pwd.rs b/pwd/pwd.rs index 4e974f221..0fea9bad0 100644 --- a/pwd/pwd.rs +++ b/pwd/pwd.rs @@ -1,4 +1,4 @@ -#[crate_id(name="pwd", vers="1.0.0", author="Heather Cynede")]; +#![crate_id(name="pwd", vers="1.0.0", author="Heather Cynede")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/rm/rm.rs b/rm/rm.rs index 4ec603d5f..0820936df 100644 --- a/rm/rm.rs +++ b/rm/rm.rs @@ -1,4 +1,4 @@ -#[crate_id(name="rm", vers="1.0.0", author="Arcterus")]; +#![crate_id(name="rm", vers="1.0.0", author="Arcterus")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/rmdir/rmdir.rs b/rmdir/rmdir.rs index 5f2d65115..d2bb7d3c1 100644 --- a/rmdir/rmdir.rs +++ b/rmdir/rmdir.rs @@ -1,4 +1,4 @@ -#[crate_id(name="rmdir", vers="1.0.0", author="Arcterus")]; +#![crate_id(name="rmdir", vers="1.0.0", author="Arcterus")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/seq/seq.rs b/seq/seq.rs index 3a98873f9..14e37b9af 100644 --- a/seq/seq.rs +++ b/seq/seq.rs @@ -1,6 +1,6 @@ -#[crate_id(name="seq", vers="1.0.0", author="Daniel MacDougall")]; +#![crate_id(name="seq", vers="1.0.0", author="Daniel MacDougall")] -#[feature(macro_rules)]; +#![feature(macro_rules)] // TODO: Make -w flag work with decimals // TODO: Support -f flag diff --git a/sleep/sleep.rs b/sleep/sleep.rs index 20492dc26..54d23ac13 100644 --- a/sleep/sleep.rs +++ b/sleep/sleep.rs @@ -1,4 +1,4 @@ -#[crate_id(name="sleep", vers="1.0.0", author="Arcterus")]; +#![crate_id(name="sleep", vers="1.0.0", author="Arcterus")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/tac/tac.rs b/tac/tac.rs index 6281cbd1a..054960ed7 100644 --- a/tac/tac.rs +++ b/tac/tac.rs @@ -1,4 +1,4 @@ -#[crate_id(name = "tac", vers = "1.0.0", author = "Arcterus")]; +#![crate_id(name = "tac", vers = "1.0.0", author = "Arcterus")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/tee/tee.rs b/tee/tee.rs index 9b4422a82..50110b92c 100644 --- a/tee/tee.rs +++ b/tee/tee.rs @@ -1,7 +1,7 @@ -#[crate_id(name="tee", vers="1.0.0", author="Aleksander Bielawski")]; -#[license="MIT"]; -#[feature(phase)]; -#[feature(macro_rules)]; +#![crate_id(name="tee", vers="1.0.0", author="Aleksander Bielawski")] +#![license="MIT"] +#![feature(phase)] +#![feature(macro_rules)] /* * This file is part of the uutils coreutils package. diff --git a/true/true.rs b/true/true.rs index 3be40528c..888e9db06 100644 --- a/true/true.rs +++ b/true/true.rs @@ -1,4 +1,4 @@ -#[crate_id(name="true", vers="1.0.0", author="Seldaek")]; +#![crate_id(name="true", vers="1.0.0", author="Seldaek")] /* * This file is part of the uutils coreutils package. diff --git a/truncate/truncate.rs b/truncate/truncate.rs index 17882e5fe..0a2947db2 100644 --- a/truncate/truncate.rs +++ b/truncate/truncate.rs @@ -1,4 +1,4 @@ -#[crate_id(name="truncate", vers="1.0.0", author="Arcterus")]; +#![crate_id(name="truncate", vers="1.0.0", author="Arcterus")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/tty/tty.rs b/tty/tty.rs index ce7683f16..b415c543e 100644 --- a/tty/tty.rs +++ b/tty/tty.rs @@ -1,4 +1,4 @@ -#[crate_id(name="tty", version="1.0.0", author="Alan Andrade")]; +#![crate_id(name="tty", version="1.0.0", author="Alan Andrade")] /* @@ -12,9 +12,9 @@ * Synced with http://lingrok.org/xref/coreutils/src/tty.c */ -#[allow(dead_code)]; +#![allow(dead_code)] -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/uptime/uptime.rs b/uptime/uptime.rs index 19ec4e8f7..6b51f0104 100644 --- a/uptime/uptime.rs +++ b/uptime/uptime.rs @@ -1,4 +1,4 @@ -#[crate_id(name="uptime", vers="1.0.0", author="José Neder")]; +#![crate_id(name="uptime", vers="1.0.0", author="José Neder")] /* * This file is part of the uutils coreutils package. @@ -11,8 +11,8 @@ /* last synced with: cat (GNU coreutils) 8.13 */ -#[allow(non_camel_case_types)]; -#[feature(macro_rules, globs)]; +#![allow(non_camel_case_types)] +#![feature(macro_rules, globs)] extern crate getopts; diff --git a/users/users.rs b/users/users.rs index d91f94d3d..75b6fdb68 100644 --- a/users/users.rs +++ b/users/users.rs @@ -1,4 +1,4 @@ -#[crate_id(name="users", vers="1.0.0", author="KokaKiwi")]; +#![crate_id(name="users", vers="1.0.0", author="KokaKiwi")] /* * This file is part of the uutils coreutils package. @@ -12,9 +12,9 @@ /* last synced with: whoami (GNU coreutils) 8.22 */ // Allow dead code here in order to keep all fields, constants here, for consistency. -#[allow(dead_code, non_camel_case_types)]; +#![allow(dead_code, non_camel_case_types)] -#[feature(macro_rules, globs)]; +#![feature(macro_rules, globs)] extern crate getopts; diff --git a/wc/wc.rs b/wc/wc.rs index ed4c72b41..7799da7a2 100644 --- a/wc/wc.rs +++ b/wc/wc.rs @@ -1,4 +1,4 @@ -#[crate_id(name="wc", vers="1.0.0", author="Boden Garman")]; +#![crate_id(name="wc", vers="1.0.0", author="Boden Garman")] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/whoami/whoami.rs b/whoami/whoami.rs index ba0b8ba9a..17ecff4cd 100644 --- a/whoami/whoami.rs +++ b/whoami/whoami.rs @@ -1,4 +1,4 @@ -#[crate_id(name="whoami", version="1.0.0", author="KokaKiwi")]; +#![crate_id(name="whoami", version="1.0.0", author="KokaKiwi")] /* * This file is part of the uutils coreutils package. @@ -11,9 +11,9 @@ /* last synced with: whoami (GNU coreutils) 8.21 */ -#[allow(non_camel_case_types)]; +#![allow(non_camel_case_types)] -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts; diff --git a/yes/yes.rs b/yes/yes.rs index 1391c625a..1ea3517c8 100644 --- a/yes/yes.rs +++ b/yes/yes.rs @@ -1,4 +1,4 @@ -#[crate_id(name="yes", vers="1.0.0", author="Seldaek")]; +#![crate_id(name="yes", vers="1.0.0", author="Seldaek")] /* * This file is part of the uutils coreutils package. @@ -11,7 +11,7 @@ /* last synced with: yes (GNU coreutils) 8.13 */ -#[feature(macro_rules)]; +#![feature(macro_rules)] extern crate getopts;