mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Update for latest Rust
This commit is contained in:
@@ -11,16 +11,16 @@
|
||||
|
||||
#[feature(macro_rules)];
|
||||
|
||||
extern crate extra;
|
||||
extern crate getopts;
|
||||
extern crate sync;
|
||||
extern crate time;
|
||||
|
||||
use std::os;
|
||||
use std::io::fs;
|
||||
use std::io::FileStat;
|
||||
use std::option::Option;
|
||||
use std::path::Path;
|
||||
use extra::time::Timespec;
|
||||
use time::Timespec;
|
||||
use sync::{Arc, Future};
|
||||
|
||||
#[path = "../util.rs"]
|
||||
@@ -337,7 +337,7 @@ Try 'du --help' for more information.");
|
||||
((time / 1000) as i64, (time % 1000 * 1000000) as i32)
|
||||
};
|
||||
let time_spec = Timespec::new(secs, nsecs);
|
||||
extra::time::at(time_spec).strftime(time_format_str)
|
||||
time::at(time_spec).strftime(time_format_str)
|
||||
};
|
||||
print!("{:<10} {:<30} {}", convert_size(size), time_str, stat.path.display());
|
||||
} else {
|
||||
|
||||
Vendored
+13
-15
@@ -11,6 +11,8 @@
|
||||
|
||||
/* last synced with: env (GNU coreutils) 8.13 */
|
||||
|
||||
#[allow(non_camel_case_types)];
|
||||
|
||||
struct options {
|
||||
ignore_env: bool,
|
||||
null: bool,
|
||||
@@ -188,21 +190,17 @@ fn main() {
|
||||
std::os::setenv(name.as_slice(), val.as_slice())
|
||||
}
|
||||
|
||||
match opts.program {
|
||||
[ref prog, ..args] => {
|
||||
match std::run::process_status(prog.as_slice(), args.as_slice()) {
|
||||
Ok(exit) =>
|
||||
std::os::set_exit_status(match exit {
|
||||
std::io::process::ExitStatus(s) => s,
|
||||
_ => 1
|
||||
}),
|
||||
Err(_) => std::os::set_exit_status(1)
|
||||
}
|
||||
}
|
||||
|
||||
[] => {
|
||||
// no program provided
|
||||
print_env(opts.null);
|
||||
if opts.program.len() >= 1 {
|
||||
match std::run::process_status(opts.program[0].as_slice(), opts.program.slice_from(1)) {
|
||||
Ok(exit) =>
|
||||
std::os::set_exit_status(match exit {
|
||||
std::io::process::ExitStatus(s) => s,
|
||||
_ => 1
|
||||
}),
|
||||
Err(_) => std::os::set_exit_status(1)
|
||||
}
|
||||
} else {
|
||||
// no program provided
|
||||
print_env(opts.null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
* http://www.opensource.apple.com/source/shell_cmds/shell_cmds-118/id/id.c
|
||||
*/
|
||||
|
||||
#[allow(non_camel_case_types)];
|
||||
|
||||
extern crate getopts;
|
||||
|
||||
use std::{libc, os, vec};
|
||||
@@ -41,7 +43,7 @@ struct c_group {
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
mod audit {
|
||||
pub use std::unstable::intrinsics::uninit;
|
||||
pub use std::mem::uninit;
|
||||
use std::libc::{uid_t, pid_t, c_int, c_uint, uint64_t, dev_t};
|
||||
|
||||
pub type au_id_t = uid_t;
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
/* 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)];
|
||||
#[allow(dead_code, non_camel_case_types)];
|
||||
|
||||
#[feature(macro_rules, globs)];
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
/* last synced with: whoami (GNU coreutils) 8.21 */
|
||||
|
||||
#[allow(non_camel_case_types)];
|
||||
|
||||
#[feature(macro_rules)];
|
||||
|
||||
extern crate extra;
|
||||
|
||||
Reference in New Issue
Block a user