1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Update for latest Rust

This commit is contained in:
Arcterus 2014-03-31 09:40:21 -07:00
parent 7201e29536
commit e898d37736
37 changed files with 80 additions and 79 deletions

View file

@ -97,6 +97,7 @@ clean: $(addprefix clean_,$(EXES))
$(RM) -rf build tmp $(RM) -rf build tmp
build: build:
git submodule update --init
mkdir build mkdir build
tmp: tmp:

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,8 +9,8 @@
* that was distributed with this source code. * that was distributed with this source code.
*/ */
#[feature(phase)]; #![feature(phase)]
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate serialize; extern crate serialize;
extern crate getopts; extern crate getopts;
@ -100,10 +100,10 @@ fn decode(input: &mut Reader, ignore_garbage: bool) {
to_decode = str::replace(to_decode, "\n", ""); to_decode = str::replace(to_decode, "\n", "");
if ignore_garbage { if ignore_garbage {
let standard_chars = let standard_chars: ~[char] =
bytes!("ABCDEFGHIJKLMNOPQRSTUVWXYZ", bytes!("ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"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 to_decode = to_decode
.trim_chars(&|c| !standard_chars.contains(&c)) .trim_chars(&|c| !standard_chars.contains(&c))

View file

@ -1,5 +1,5 @@
#[feature(macro_rules)]; #![feature(macro_rules)]
#[crate_id(name="basename", vers="1.0.0", author="Jimmy Lu")]; #![crate_id(name="basename", vers="1.0.0", author="Jimmy Lu")]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.

View file

@ -1,5 +1,5 @@
#[crate_id(name="cat", vers="1.0.0", author="Seldaek")]; #![crate_id(name="cat", vers="1.0.0", author="Seldaek")]
#[feature(managed_boxes)]; #![feature(managed_boxes)]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.

View file

@ -1,4 +1,4 @@
#[allow(dead_code, non_camel_case_types)]; #![allow(dead_code, non_camel_case_types)]
extern crate getopts; extern crate getopts;

View file

@ -7,7 +7,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[macro_escape]; #![macro_escape]
#[macro_export] #[macro_export]
macro_rules! show_error( macro_rules! show_error(

View file

@ -1,5 +1,5 @@
#[allow(non_camel_case_types)]; #![allow(non_camel_case_types)]
#[allow(dead_code)]; #![allow(dead_code)]
pub use self::utmpx::{DEFAULT_FILE,USER_PROCESS,BOOT_TIME,c_utmp}; pub use self::utmpx::{DEFAULT_FILE,USER_PROCESS,BOOT_TIME,c_utmp};
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]

View file

@ -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. * This file is part of the uutils coreutils package.

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,8 +9,8 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[allow(uppercase_variables)]; #![allow(uppercase_variables)]
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;
extern crate sync; extern crate sync;
@ -47,8 +47,8 @@ fn du(path: &Path, mut my_stat: FileStat,
let read = match fs::readdir(path) { let read = match fs::readdir(path) {
Ok(read) => read, Ok(read) => read,
Err(e) => { Err(e) => {
writeln!(&mut stderr(), "{}: cannot read directory {}: {}", safe_writeln!(&mut stderr(), "{}: cannot read directory {}: {}",
options.program_name, path.display(), e); options.program_name, path.display(), e);
return ~[Arc::new(my_stat)] return ~[Arc::new(my_stat)]
} }
}; };

View file

@ -1,5 +1,5 @@
#[feature(macro_rules)]; #![feature(macro_rules)]
#[crate_id(name="echo", vers="1.0.0", author="Derek Chiang")]; #![crate_id(name="echo", vers="1.0.0", author="Derek Chiang")]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.

4
env/env.rs vendored
View file

@ -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. * This file is part of the uutils coreutils package.
@ -11,7 +11,7 @@
/* last synced with: env (GNU coreutils) 8.13 */ /* last synced with: env (GNU coreutils) 8.13 */
#[allow(non_camel_case_types)]; #![allow(non_camel_case_types)]
struct options { struct options {
ignore_env: bool, ignore_env: bool,

View file

@ -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. * This file is part of the uutils coreutils package.

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
* *
@ -8,7 +8,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
* *
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
* *

View file

@ -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. * This file is part of the uutils coreutils package.
* *

View file

@ -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. * 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 * http://www.opensource.apple.com/source/shell_cmds/shell_cmds-118/id/id.c
*/ */
#[allow(non_camel_case_types)]; #![allow(non_camel_case_types)]
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;
use std::{libc, os}; use std::{libc, os};

View file

@ -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. * This file is part of the uutils coreutils package.
@ -11,9 +11,9 @@
/* last synced with: logname (GNU coreutils) 8.22 */ /* 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; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate crypto = "rust-crypto"; extern crate crypto = "rust-crypto";
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -11,7 +11,7 @@
/* last synced with: printenv (GNU coreutils) 8.13 */ /* last synced with: printenv (GNU coreutils) 8.13 */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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: Make -w flag work with decimals
// TODO: Support -f flag // TODO: Support -f flag

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -1,7 +1,7 @@
#[crate_id(name="tee", vers="1.0.0", author="Aleksander Bielawski")]; #![crate_id(name="tee", vers="1.0.0", author="Aleksander Bielawski")]
#[license="MIT"]; #![license="MIT"]
#[feature(phase)]; #![feature(phase)]
#[feature(macro_rules)]; #![feature(macro_rules)]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.

View file

@ -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. * This file is part of the uutils coreutils package.

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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 * 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; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -11,8 +11,8 @@
/* last synced with: cat (GNU coreutils) 8.13 */ /* last synced with: cat (GNU coreutils) 8.13 */
#[allow(non_camel_case_types)]; #![allow(non_camel_case_types)]
#[feature(macro_rules, globs)]; #![feature(macro_rules, globs)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -12,9 +12,9 @@
/* last synced with: whoami (GNU coreutils) 8.22 */ /* 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 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; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -11,9 +11,9 @@
/* last synced with: whoami (GNU coreutils) 8.21 */ /* 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; extern crate getopts;

View file

@ -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. * This file is part of the uutils coreutils package.
@ -11,7 +11,7 @@
/* last synced with: yes (GNU coreutils) 8.13 */ /* last synced with: yes (GNU coreutils) 8.13 */
#[feature(macro_rules)]; #![feature(macro_rules)]
extern crate getopts; extern crate getopts;