mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #718 from jbcrail/uucore
Split utility files into separate library.
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
target/
|
||||
/src/*/gen_table
|
||||
/target/
|
||||
/build/
|
||||
/tmp/
|
||||
/busybox/
|
||||
*~
|
||||
|
||||
@@ -85,6 +85,7 @@ all = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
uucore = { path="src/uucore" }
|
||||
base64 = { optional=true, path="src/base64" }
|
||||
basename = { optional=true, path="src/basename" }
|
||||
cat = { optional=true, path="src/cat" }
|
||||
|
||||
@@ -11,6 +11,7 @@ path = "base64.rs"
|
||||
getopts = "*"
|
||||
libc = "*"
|
||||
rustc-serialize = "*"
|
||||
uucore = { path="../uucore" }
|
||||
|
||||
[[bin]]
|
||||
name="base64"
|
||||
|
||||
@@ -13,6 +13,9 @@ extern crate rustc_serialize as serialize;
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use getopts::Options;
|
||||
use serialize::base64::{self, FromBase64, ToBase64};
|
||||
use std::ascii::AsciiExt;
|
||||
@@ -21,10 +24,6 @@ use std::fs::File;
|
||||
use std::io::{BufReader, Read, stdin, stdout, Write};
|
||||
use std::path::Path;
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
enum Mode {
|
||||
Decode,
|
||||
Encode,
|
||||
|
||||
@@ -10,6 +10,7 @@ path = "basename.rs"
|
||||
[dependencies]
|
||||
getopts = "*"
|
||||
libc = "*"
|
||||
uucore = { path="../uucore" }
|
||||
|
||||
[[bin]]
|
||||
name="basename"
|
||||
|
||||
@@ -12,14 +12,13 @@
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use getopts::Options;
|
||||
use std::io::Write;
|
||||
use std::path::{is_separator, PathBuf};
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
static NAME: &'static str = "basename";
|
||||
static VERSION: &'static str = "1.0.0";
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ path = "cat.rs"
|
||||
[dependencies]
|
||||
getopts = "*"
|
||||
libc = "*"
|
||||
uucore = { path="../uucore" }
|
||||
|
||||
[[bin]]
|
||||
name="cat"
|
||||
|
||||
+5
-6
@@ -14,16 +14,15 @@
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use libc::STDIN_FILENO;
|
||||
use libc::{c_int, isatty};
|
||||
use getopts::Options;
|
||||
use std::fs::File;
|
||||
use std::intrinsics::{copy_nonoverlapping};
|
||||
use std::io::{stdout, stdin, stderr, Write, Read, Result};
|
||||
use libc::STDIN_FILENO;
|
||||
use libc::{c_int, isatty};
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
static NAME: &'static str = "cat";
|
||||
static VERSION: &'static str = "1.0.0";
|
||||
|
||||
@@ -14,6 +14,7 @@ aho-corasick = "*"
|
||||
memchr = "*"
|
||||
regex = "*"
|
||||
regex-syntax = "*"
|
||||
uucore = { path="../uucore" }
|
||||
walker = "*"
|
||||
|
||||
[[bin]]
|
||||
|
||||
+4
-9
@@ -19,23 +19,18 @@ extern crate regex;
|
||||
extern crate regex_syntax;
|
||||
extern crate walker;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use getopts::Options;
|
||||
use regex::Regex;
|
||||
use std::ffi::CString;
|
||||
use std::io::{Error, Write};
|
||||
use std::mem;
|
||||
use std::path::Path;
|
||||
use uucore::fs::UUPathExt;
|
||||
use walker::Walker;
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
#[path = "../common/filesystem.rs"]
|
||||
mod filesystem;
|
||||
|
||||
use filesystem::UUPathExt;
|
||||
|
||||
const NAME: &'static str = "chmod";
|
||||
const VERSION: &'static str = "1.0.0";
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ path = "chroot.rs"
|
||||
[dependencies]
|
||||
getopts = "*"
|
||||
libc = "*"
|
||||
uucore = { path="../uucore" }
|
||||
|
||||
[[bin]]
|
||||
name="chroot"
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use c_types::{get_pw_from_args, get_group};
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use getopts::Options;
|
||||
use libc::{setgid, setuid};
|
||||
use std::ffi::CString;
|
||||
@@ -20,12 +22,8 @@ use std::io::{Error, Write};
|
||||
use std::iter::FromIterator;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
|
||||
#[path = "../common/util.rs"] #[macro_use] mod util;
|
||||
#[path = "../common/c_types.rs"] mod c_types;
|
||||
#[path = "../common/filesystem.rs"] mod filesystem;
|
||||
|
||||
use filesystem::UUPathExt;
|
||||
use uucore::c_types::{get_pw_from_args, get_group};
|
||||
use uucore::fs::UUPathExt;
|
||||
|
||||
extern {
|
||||
fn chroot(path: *const libc::c_char) -> libc::c_int;
|
||||
|
||||
@@ -10,6 +10,7 @@ path = "cksum.rs"
|
||||
[dependencies]
|
||||
getopts = "*"
|
||||
libc = "*"
|
||||
uucore = { path="../uucore" }
|
||||
|
||||
[[bin]]
|
||||
name="cksum"
|
||||
|
||||
+3
-4
@@ -11,6 +11,9 @@
|
||||
|
||||
extern crate getopts;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use getopts::Options;
|
||||
use std::fs::File;
|
||||
use std::io::{self, stdin, Read, Write, BufReader};
|
||||
@@ -19,10 +22,6 @@ use std::path::Path;
|
||||
|
||||
use crc_table::CRC_TABLE;
|
||||
|
||||
#[path="../common/util.rs"]
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
mod crc_table;
|
||||
|
||||
static NAME: &'static str = "cksum";
|
||||
|
||||
@@ -10,6 +10,7 @@ path = "cp.rs"
|
||||
[dependencies]
|
||||
getopts = "*"
|
||||
libc = "*"
|
||||
uucore = { path="../uucore" }
|
||||
|
||||
[[bin]]
|
||||
name="cp"
|
||||
|
||||
+4
-9
@@ -11,19 +11,14 @@
|
||||
|
||||
extern crate getopts;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use getopts::Options;
|
||||
use std::fs;
|
||||
use std::io::{ErrorKind, Result, Write};
|
||||
use std::path::Path;
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
#[path = "../common/filesystem.rs"]
|
||||
mod filesystem;
|
||||
|
||||
use filesystem::{canonicalize, CanonicalizeMode, UUPathExt};
|
||||
use uucore::fs::{canonicalize, CanonicalizeMode, UUPathExt};
|
||||
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
pub enum Mode {
|
||||
|
||||
@@ -10,6 +10,7 @@ path = "cut.rs"
|
||||
[dependencies]
|
||||
getopts = "*"
|
||||
libc = "*"
|
||||
uucore = { path="../uucore" }
|
||||
|
||||
[[bin]]
|
||||
name="cut"
|
||||
|
||||
+4
-9
@@ -12,22 +12,17 @@
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::{stdout, stdin, BufRead, BufReader, Read, Stdout, Write};
|
||||
use std::path::Path;
|
||||
use uucore::fs::UUPathExt;
|
||||
|
||||
use ranges::Range;
|
||||
use searcher::Searcher;
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
#[path = "../common/filesystem.rs"]
|
||||
mod filesystem;
|
||||
|
||||
use filesystem::UUPathExt;
|
||||
|
||||
mod buffer;
|
||||
mod ranges;
|
||||
mod searcher;
|
||||
|
||||
@@ -11,6 +11,7 @@ path = "du.rs"
|
||||
getopts = "*"
|
||||
libc = "*"
|
||||
time = "*"
|
||||
uucore = { path="../uucore" }
|
||||
|
||||
[[bin]]
|
||||
name="du"
|
||||
|
||||
+3
-4
@@ -15,6 +15,9 @@ extern crate getopts;
|
||||
extern crate libc;
|
||||
extern crate time;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use std::fs;
|
||||
use std::io::{stderr, Write};
|
||||
use std::os::unix::fs::MetadataExt;
|
||||
@@ -24,10 +27,6 @@ use time::Timespec;
|
||||
use std::sync::mpsc::channel;
|
||||
use std::thread;
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
static NAME: &'static str = "du";
|
||||
static VERSION: &'static str = "1.0.0";
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user