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:
parent
7201e29536
commit
e898d37736
37 changed files with 80 additions and 79 deletions
1
Makefile
1
Makefile
|
@ -97,6 +97,7 @@ clean: $(addprefix clean_,$(EXES))
|
|||
$(RM) -rf build tmp
|
||||
|
||||
build:
|
||||
git submodule update --init
|
||||
mkdir build
|
||||
|
||||
tmp:
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#[allow(dead_code, non_camel_case_types)];
|
||||
#![allow(dead_code, non_camel_case_types)]
|
||||
|
||||
extern crate getopts;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
#[macro_escape];
|
||||
#![macro_escape]
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! show_error(
|
||||
|
|
|
@ -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")]
|
||||
|
|
|
@ -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.
|
||||
|
|
10
du/du.rs
10
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)]
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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.
|
||||
|
|
4
env/env.rs
vendored
4
env/env.rs
vendored
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
6
id/id.rs
6
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};
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
4
rm/rm.rs
4
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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
4
wc/wc.rs
4
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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue