1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #740 from jbcrail/simplify-build

Refactor and simplify build for utilities
This commit is contained in:
Michael Gehring 2015-12-08 18:02:05 +01:00
commit b964014b31
226 changed files with 698 additions and 705 deletions

View file

@ -177,5 +177,5 @@ rand="*"
tempdir="*" tempdir="*"
[[bin]] [[bin]]
name="uutils" name = "uutils"
path="src/uutils/uutils.rs" path = "src/uutils/uutils.rs"

View file

@ -168,11 +168,6 @@ test_integration_$(1): build_exe_$(1)
${CARGO} test --test $(1) --features $(1) --no-default-features ${CARGO} test --test $(1) --features $(1) --no-default-features
endef endef
define TEST_UNIT
test_unit_$(1):
${CARGO} test -p $(1)
endef
# Output names # Output names
EXES := \ EXES := \
$(sort $(filter $(BUILD),$(filter-out $(DONT_BUILD),$(PROGS)))) $(sort $(filter $(BUILD),$(filter-out $(DONT_BUILD),$(PROGS))))
@ -213,9 +208,8 @@ build-uutils: $(addprefix build_exe_,$(EXES))
build: build-uutils build: build-uutils
$(foreach test,$(TESTS),$(eval $(call TEST_INTEGRATION,$(test)))) $(foreach test,$(TESTS),$(eval $(call TEST_INTEGRATION,$(test))))
$(foreach test,$(TESTS),$(eval $(call TEST_UNIT,$(test))))
test: $(addprefix test_integration_,$(TESTS)) $(addprefix test_unit_,$(TESTS)) test: $(addprefix test_integration_,$(TESTS))
clean: clean:
$(RM) -rf $(BUILDDIR) $(RM) -rf $(BUILDDIR)

View file

@ -12,49 +12,43 @@ pub fn main() {
if val == "1" && key.starts_with(feature_prefix) { if val == "1" && key.starts_with(feature_prefix) {
let krate = key[feature_prefix.len()..].to_lowercase(); let krate = key[feature_prefix.len()..].to_lowercase();
match krate.as_ref() { match krate.as_ref() {
"default" | "unix" | "generic" => continue, "default" | "unix" | "generic" => continue,
_ => {}, _ => {},
} }
crates.push(krate.to_string()); crates.push(krate.to_string());
} }
} }
crates.sort(); crates.sort();
let mut cf = File::create(Path::new(&out_dir).join("uutils_crates.rs")).unwrap(); let mut cf = File::create(Path::new(&out_dir).join("uutils_crates.rs")).unwrap();
let mut mf = File::create(Path::new(&out_dir).join("uutils_map.rs")).unwrap(); let mut mf = File::create(Path::new(&out_dir).join("uutils_map.rs")).unwrap();
mf.write_all(" mf.write_all("
type UtilityMap = HashMap<&'static str, fn(Vec<String>) -> i32>; type UtilityMap = HashMap<&'static str, fn(Vec<String>) -> i32>;
fn util_map() -> UtilityMap { fn util_map() -> UtilityMap {
let mut map: UtilityMap = HashMap::new();\n".as_bytes()).unwrap(); let mut map: UtilityMap = HashMap::new();\n".as_bytes()).unwrap();
for krate in crates { for krate in crates {
match krate.as_ref() { cf.write_all(format!("extern crate uu_{krate};\n", krate=krate).as_bytes()).unwrap();
"false" | "true" => {},
"test" => cf.write_all(format!("extern crate uu{krate};\n", krate=krate).as_bytes()).unwrap(),
_ => cf.write_all(format!("extern crate {krate} as uu{krate};\n", krate=krate).as_bytes()).unwrap(),
}
match krate.as_ref() { match krate.as_ref() {
"hashsum" => { "hashsum" => {
mf.write_all("map.insert(\"hashsum\", uuhashsum::uumain); mf.write_all("map.insert(\"hashsum\", uu_hashsum::uumain);
map.insert(\"md5sum\", uuhashsum::uumain); map.insert(\"md5sum\", uu_hashsum::uumain);
map.insert(\"sha1sum\", uuhashsum::uumain); map.insert(\"sha1sum\", uu_hashsum::uumain);
map.insert(\"sha224sum\", uuhashsum::uumain); map.insert(\"sha224sum\", uu_hashsum::uumain);
map.insert(\"sha256sum\", uuhashsum::uumain); map.insert(\"sha256sum\", uu_hashsum::uumain);
map.insert(\"sha384sum\", uuhashsum::uumain); map.insert(\"sha384sum\", uu_hashsum::uumain);
map.insert(\"sha512sum\", uuhashsum::uumain);\n".as_bytes()).unwrap(); map.insert(\"sha512sum\", uu_hashsum::uumain);\n".as_bytes()).unwrap();
}, },
"false" =>
mf.write_all("fn uufalse(_: Vec<String>) -> i32 { 1 }
map.insert(\"false\", uufalse as fn(Vec<String>) -> i32);\n".as_bytes()).unwrap(),
"true" =>
mf.write_all("fn uutrue(_: Vec<String>) -> i32 { 0 }
map.insert(\"true\", uutrue as fn(Vec<String>) -> i32);\n".as_bytes()).unwrap(),
_ => _ =>
mf.write_all(format!("map.insert(\"{krate}\", uu{krate}::uumain as fn(Vec<String>) -> i32);\n", krate= krate).as_bytes()).unwrap(), mf.write_all(format!("map.insert(\"{krate}\", uu_{krate}::uumain);\n", krate=krate).as_bytes()).unwrap(),
} }
} }
mf.write_all("map
}\n".as_bytes()).unwrap(); mf.write_all("map\n}\n".as_bytes()).unwrap();
cf.flush().unwrap(); cf.flush().unwrap();
mf.flush().unwrap(); mf.flush().unwrap();
} }

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "base64" name = "uu_base64"
path = "base64.rs" path = "base64.rs"
[dependencies] [dependencies]
@ -14,5 +14,5 @@ rustc-serialize = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="base64" name = "base64"
path="base64.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "base64"] #![crate_name = "uu_base64"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -159,8 +159,3 @@ fn help(opts: Options) {
fn version() { fn version() {
println!("{} {}", NAME, VERSION); println!("{} {}", NAME, VERSION);
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/base64/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_base64;
fn main() {
std::process::exit(uu_base64::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "basename" name = "uu_basename"
path = "basename.rs" path = "basename.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="basename" name = "basename"
path="basename.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "basename"] #![crate_name = "uu_basename"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -105,8 +105,3 @@ fn strip_suffix(name: &str, suffix: &str) -> String {
name.to_string() name.to_string()
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/basename/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_basename;
fn main() {
std::process::exit(uu_basename::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "cat" name = "uu_cat"
path = "cat.rs" path = "cat.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="cat" name = "cat"
path="cat.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "cat"] #![crate_name = "uu_cat"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -339,10 +339,3 @@ impl<'a, W: Write> Drop for UnsafeWriter<'a, W> {
let _ = self.flush_buf(); let _ = self.flush_buf();
} }
} }
/* vim: set ai ts=4 sw=4 sts=4 et : */
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/cat/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_cat;
fn main() {
std::process::exit(uu_cat::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "chmod" name = "uu_chmod"
path = "chmod.rs" path = "chmod.rs"
[dependencies] [dependencies]
@ -18,5 +18,5 @@ uucore = { path="../uucore" }
walker = "*" walker = "*"
[[bin]] [[bin]]
name="chmod" name = "chmod"
path="chmod.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "chmod"] #![crate_name = "uu_chmod"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -319,8 +319,3 @@ fn chmod_file(file: &Path, name: &str, changes: bool, quiet: bool, verbose: bool
Ok(()) Ok(())
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/chmod/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_chmod;
fn main() {
std::process::exit(uu_chmod::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "chroot" name = "uu_chroot"
path = "chroot.rs" path = "chroot.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="chroot" name = "chroot"
path="chroot.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "chroot"] #![crate_name = "uu_chroot"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -216,8 +216,3 @@ If $(SHELL) is not set, /bin/sh is used.", NAME, VERSION);
print!("{}", options.usage(&msg)); print!("{}", options.usage(&msg));
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/chroot/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_chroot;
fn main() {
std::process::exit(uu_chroot::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "cksum" name = "uu_cksum"
path = "cksum.rs" path = "cksum.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="cksum" name = "cksum"
path="cksum.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "cksum"] #![crate_name = "uu_cksum"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -128,8 +128,3 @@ Print CRC and size for each file.", NAME, VERSION);
exit_code exit_code
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/cksum/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_cksum;
fn main() {
std::process::exit(uu_cksum::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "comm" name = "uu_comm"
path = "comm.rs" path = "comm.rs"
[dependencies] [dependencies]
@ -12,5 +12,5 @@ getopts = "*"
libc = "*" libc = "*"
[[bin]] [[bin]]
name="comm" name = "comm"
path="comm.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "comm"] #![crate_name = "uu_comm"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -163,8 +163,3 @@ Compare sorted files line by line.", NAME, VERSION);
0 0
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/comm/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_comm;
fn main() {
std::process::exit(uu_comm::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "cp" name = "uu_cp"
path = "cp.rs" path = "cp.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="cp" name = "cp"
path="cp.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "cp"] #![crate_name = "uu_cp"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -154,8 +154,3 @@ pub fn paths_refer_to_same_file(p1: &Path, p2: &Path) -> Result<bool> {
Ok(pathbuf1 == pathbuf2) Ok(pathbuf1 == pathbuf2)
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/cp/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_cp;
fn main() {
std::process::exit(uu_cp::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "cut" name = "uu_cut"
path = "cut.rs" path = "cut.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="cut" name = "cut"
path="cut.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "cut"] #![crate_name = "uu_cut"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -539,8 +539,3 @@ pub fn uumain(args: Vec<String>) -> i32 {
} }
} }
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/cut/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_cut;
fn main() {
std::process::exit(uu_cut::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "dirname" name = "uu_dirname"
path = "dirname.rs" path = "dirname.rs"
[dependencies] [dependencies]
@ -12,5 +12,5 @@ getopts = "*"
libc = "*" libc = "*"
[[bin]] [[bin]]
name="dirname" name = "dirname"
path="dirname.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "dirname"] #![crate_name = "uu_dirname"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -68,8 +68,3 @@ directory).", NAME, VERSION);
0 0
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/dirname/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_dirname;
fn main() {
std::process::exit(uu_dirname::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "du" name = "uu_du"
path = "du.rs" path = "du.rs"
[dependencies] [dependencies]
@ -14,5 +14,5 @@ time = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="du" name = "du"
path="du.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "du"] #![crate_name = "uu_du"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -395,8 +395,3 @@ Try '{} --help' for more information.", s, NAME);
0 0
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/du/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_du;
fn main() {
std::process::exit(uu_du::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "echo" name = "uu_echo"
path = "echo.rs" path = "echo.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="echo" name = "echo"
path="echo.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "echo"] #![crate_name = "uu_echo"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -251,8 +251,3 @@ pub fn uumain(args: Vec<String>) -> i32 {
0 0
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/echo/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_echo;
fn main() {
std::process::exit(uu_echo::uumain(std::env::args().collect()));
}

6
src/env/Cargo.toml vendored
View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "env" name = "uu_env"
path = "env.rs" path = "env.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="env" name = "env"
path="env.rs" path = "main.rs"

7
src/env/env.rs vendored
View file

@ -1,4 +1,4 @@
#![crate_name = "env"] #![crate_name = "uu_env"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -204,8 +204,3 @@ pub fn uumain(args: Vec<String>) -> i32 {
0 0
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(env::args().collect()));
}

5
src/env/main.rs vendored Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_env;
fn main() {
std::process::exit(uu_env::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "expand" name = "uu_expand"
path = "expand.rs" path = "expand.rs"
[dependencies] [dependencies]
@ -14,5 +14,5 @@ unicode-width = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="expand" name = "expand"
path="expand.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "expand"] #![crate_name = "uu_expand"]
#![feature(unicode)] #![feature(unicode)]
/* /*
@ -241,8 +241,3 @@ fn expand(options: Options) {
} }
} }
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/expand/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_expand;
fn main() {
std::process::exit(uu_expand::uumain(std::env::args().collect()));
}

View file

@ -1,11 +1,10 @@
[package] [package]
name = "expr" name = "expr"
version = "0.0.1" version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "expr" name = "uu_expr"
path = "expr.rs" path = "expr.rs"
[dependencies] [dependencies]
@ -14,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="expr" name = "expr"
path="expr.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "expr"] #![crate_name = "uu_expr"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -61,8 +61,6 @@ fn evaluate_ast( maybe_ast: Result<Box<syntax_tree::ASTNode>, String> ) -> Resul
else { maybe_ast.ok().unwrap().evaluate() } else { maybe_ast.ok().unwrap().evaluate() }
} }
fn maybe_handle_help_or_version( args: &Vec<String> ) -> bool { fn maybe_handle_help_or_version( args: &Vec<String> ) -> bool {
if args.len() == 2 { if args.len() == 2 {
if args[1] == "--help" { print_help(); true } if args[1] == "--help" { print_help(); true }
@ -133,8 +131,3 @@ Environment variables:
fn print_version() { fn print_version() {
println!("{} {}", NAME, VERSION); println!("{} {}", NAME, VERSION);
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/expr/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_expr;
fn main() {
std::process::exit(uu_expr::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "factor" name = "uu_factor"
path = "factor.rs" path = "factor.rs"
[dependencies] [dependencies]
@ -14,5 +14,5 @@ rand = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="factor" name = "factor"
path="factor.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "factor"] #![crate_name = "uu_factor"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -200,8 +200,3 @@ read from standard input.", NAME, VERSION);
} }
0 0
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/factor/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_factor;
fn main() {
std::process::exit(uu_factor::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "false" name = "uu_false"
path = "false.rs" path = "false.rs"
[dependencies] [dependencies]
@ -12,5 +12,5 @@ getopts = "*"
libc = "*" libc = "*"
[[bin]] [[bin]]
name="false" name = "false"
path="false.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "false"] #![crate_name = "uu_false"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -12,8 +12,3 @@
pub fn uumain(_: Vec<String>) -> i32 { pub fn uumain(_: Vec<String>) -> i32 {
1 1
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/false/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_false;
fn main() {
std::process::exit(uu_false::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "fmt" name = "uu_fmt"
path = "fmt.rs" path = "fmt.rs"
[dependencies] [dependencies]
@ -14,5 +14,5 @@ unicode-width = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="fmt" name = "fmt"
path="fmt.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "fmt"] #![crate_name = "uu_fmt"]
#![feature(iter_cmp, str_char, unicode)] #![feature(iter_cmp, str_char, unicode)]
/* /*
@ -219,8 +219,3 @@ pub fn uumain(args: Vec<String>) -> i32 {
0 0
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/fmt/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_fmt;
fn main() {
std::process::exit(uu_fmt::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "fold" name = "uu_fold"
path = "fold.rs" path = "fold.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="fold" name = "fold"
path="fold.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "fold"] #![crate_name = "uu_fold"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -219,8 +219,3 @@ fn rfind_whitespace(slice: &str) -> Option<usize> {
} }
None None
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/fold/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_fold;
fn main() {
std::process::exit(uu_fold::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "groups" name = "uu_groups"
path = "groups.rs" path = "groups.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="groups" name = "groups"
path="groups.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "groups"] #![crate_name = "uu_groups"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -51,8 +51,3 @@ Prints the groups a user is in to standard output.", NAME, VERSION);
0 0
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/groups/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_groups;
fn main() {
std::process::exit(uu_groups::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "hashsum" name = "uu_hashsum"
path = "hashsum.rs" path = "hashsum.rs"
[dependencies] [dependencies]
@ -16,5 +16,5 @@ rust-crypto = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="hashsum" name = "hashsum"
path="hashsum.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "hashsum"] #![crate_name = "uu_hashsum"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -306,8 +306,3 @@ fn digest_reader<'a, T: Read>(digest: &mut Box<Digest+'a>, reader: &mut BufReade
Ok(digest.result_str()) Ok(digest.result_str())
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/hashsum/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_hashsum;
fn main() {
std::process::exit(uu_hashsum::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "head" name = "uu_head"
path = "head.rs" path = "head.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="head" name = "head"
path="head.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "head"] #![crate_name = "uu_head"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -207,8 +207,3 @@ fn head<T: Read>(reader: &mut BufReader<T>, settings: &Settings) -> bool {
fn version() { fn version() {
println!("{} {}", NAME, VERSION); println!("{} {}", NAME, VERSION);
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/head/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_head;
fn main() {
std::process::exit(uu_head::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "hostid" name = "uu_hostid"
path = "hostid.rs" path = "hostid.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="hostid" name = "hostid"
path="hostid.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "hostid"] #![crate_name = "uu_hostid"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -87,8 +87,3 @@ fn hostid() {
result &= 0xffffffff; result &= 0xffffffff;
println!("{:0>8x}", result); println!("{:0>8x}", result);
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/hostid/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_hostid;
fn main() {
std::process::exit(uu_hostid::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "hostname" name = "uu_hostname"
path = "hostname.rs" path = "hostname.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="hostname" name = "hostname"
path="hostname.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "hostname"] #![crate_name = "uu_hostname"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -174,8 +174,3 @@ fn xsethostname(name: &str) {
println!("Cannot set hostname to {}", name); println!("Cannot set hostname to {}", name);
} }
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/hostname/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_hostname;
fn main() {
std::process::exit(uu_hostname::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "id" name = "uu_id"
path = "id.rs" path = "id.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="id" name = "id"
path="id.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "id"] #![crate_name = "uu_id"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -394,8 +394,3 @@ fn id_print(possible_pw: Option<c_passwd>, p_euid: bool, p_egid: bool) {
println!(""); println!("");
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/id/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_id;
fn main() {
std::process::exit(uu_id::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "kill" name = "uu_kill"
path = "kill.rs" path = "kill.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="kill" name = "kill"
path="kill.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "kill"] #![crate_name = "uu_kill"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -185,8 +185,3 @@ fn kill(signalname: &str, pids: std::vec::Vec<String>) -> i32 {
} }
status status
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/kill/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_kill;
fn main() {
std::process::exit(uu_kill::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "link" name = "uu_link"
path = "link.rs" path = "link.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="link" name = "link"
path="link.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "link"] #![crate_name = "uu_link"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -63,8 +63,3 @@ Create a link named FILE2 to FILE1.", NAME, VERSION);
} }
} }
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/link/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_link;
fn main() {
std::process::exit(uu_link::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "ln" name = "uu_ln"
path = "ln.rs" path = "ln.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="ln" name = "ln"
path="ln.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "ln"] #![crate_name = "uu_ln"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -326,8 +326,3 @@ pub fn is_symlink<P: AsRef<Path>>(path: P) -> bool {
Err(_) => false Err(_) => false
} }
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/ln/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_ln;
fn main() {
std::process::exit(uu_ln::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "logname" name = "uu_logname"
path = "logname.rs" path = "logname.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="logname" name = "logname"
path="logname.rs" path = "main.rs"

View file

@ -1,4 +1,4 @@
#![crate_name = "logname"] #![crate_name = "uu_logname"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -80,8 +80,3 @@ fn exec() {
None => println!("{}: no login name", NAME) None => println!("{}: no login name", NAME)
} }
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

5
src/logname/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_logname;
fn main() {
std::process::exit(uu_logname::uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "mkdir" name = "uu_mkdir"
path = "mkdir.rs" path = "mkdir.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="mkdir" name = "mkdir"
path="mkdir.rs" path = "main.rs"

5
src/mkdir/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_mkdir;
fn main() {
std::process::exit(uu_mkdir::uumain(std::env::args().collect()));
}

View file

@ -1,4 +1,4 @@
#![crate_name = "mkdir"] #![crate_name = "uu_mkdir"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -155,8 +155,3 @@ fn mkdir(path: &Path, mode: u16, verbose: bool) -> i32 {
} }
chmod(path, mode) chmod(path, mode)
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "mkfifo" name = "uu_mkfifo"
path = "mkfifo.rs" path = "mkfifo.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="mkfifo" name = "mkfifo"
path="mkfifo.rs" path = "main.rs"

5
src/mkfifo/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_mkfifo;
fn main() {
std::process::exit(uu_mkfifo::uumain(std::env::args().collect()));
}

View file

@ -1,4 +1,4 @@
#![crate_name = "mkfifo"] #![crate_name = "uu_mkfifo"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -76,8 +76,3 @@ Create a FIFO with the given name.", NAME, VERSION);
exit_status exit_status
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "mv" name = "uu_mv"
path = "mv.rs" path = "mv.rs"
[dependencies] [dependencies]
@ -16,5 +16,5 @@ uucore = { path="../uucore" }
time = "*" time = "*"
[[bin]] [[bin]]
name="mv" name = "mv"
path="mv.rs" path = "main.rs"

5
src/mv/main.rs Normal file
View file

@ -0,0 +1,5 @@
extern crate uu_mv;
fn main() {
std::process::exit(uu_mv::uumain(std::env::args().collect()));
}

View file

@ -1,4 +1,4 @@
#![crate_name = "mv"] #![crate_name = "uu_mv"]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -351,8 +351,3 @@ fn existing_backup_path(path: &PathBuf, suffix: &String) -> PathBuf {
} }
simple_backup_path(path, suffix) simple_backup_path(path, suffix)
} }
#[allow(dead_code)]
fn main() {
std::process::exit(uumain(std::env::args().collect()));
}

View file

@ -4,7 +4,7 @@ version = "0.0.1"
authors = [] authors = []
[lib] [lib]
name = "nice" name = "uu_nice"
path = "nice.rs" path = "nice.rs"
[dependencies] [dependencies]
@ -13,5 +13,5 @@ libc = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]
name="nice" name = "nice"
path="nice.rs" path = "main.rs"

Some files were not shown because too many files have changed in this diff Show more