Skip to content

Commit 390d074

Browse files
authored
Merge pull request #265 from cakebaker/build_rs_remove_coreutils_stuff
build.rs: remove `coreutils` stuff
2 parents f67f108 + 07d7534 commit 390d074

File tree

1 file changed

+5
-44
lines changed

1 file changed

+5
-44
lines changed

build.rs

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file is part of the uutils coreutils package.
1+
// This file is part of the uutils util-linux package.
22
//
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
@@ -11,14 +11,13 @@ use std::io::Write;
1111
use std::path::Path;
1212

1313
pub fn main() {
14+
const ENV_FEATURE_PREFIX: &str = "CARGO_FEATURE_";
15+
const FEATURE_PREFIX: &str = "feat_";
16+
1417
if let Ok(profile) = env::var("PROFILE") {
1518
println!("cargo:rustc-cfg=build={profile:?}");
1619
}
1720

18-
const ENV_FEATURE_PREFIX: &str = "CARGO_FEATURE_";
19-
const FEATURE_PREFIX: &str = "feat_";
20-
const OVERRIDE_PREFIX: &str = "uu_";
21-
2221
let out_dir = env::var("OUT_DIR").unwrap();
2322

2423
let mut crates = Vec::new();
@@ -54,45 +53,7 @@ pub fn main() {
5453
let mut phf_map = phf_codegen::OrderedMap::<&str>::new();
5554
for krate in &crates {
5655
let map_value = format!("({krate}::uumain, {krate}::uu_app)");
57-
match krate.as_ref() {
58-
// 'test' is named uu_test to avoid collision with rust core crate 'test'.
59-
// It can also be invoked by name '[' for the '[ expr ] syntax'.
60-
"uu_test" => {
61-
phf_map.entry("test", &map_value);
62-
phf_map.entry("[", &map_value);
63-
}
64-
k if k.starts_with(OVERRIDE_PREFIX) => {
65-
phf_map.entry(&k[OVERRIDE_PREFIX.len()..], &map_value);
66-
}
67-
"false" | "true" => {
68-
phf_map.entry(krate, &format!("(r#{krate}::uumain, r#{krate}::uu_app)"));
69-
}
70-
"hashsum" => {
71-
phf_map.entry(krate, &format!("({krate}::uumain, {krate}::uu_app_custom)"));
72-
73-
let map_value = format!("({krate}::uumain, {krate}::uu_app_common)");
74-
let map_value_bits = format!("({krate}::uumain, {krate}::uu_app_bits)");
75-
let map_value_b3sum = format!("({krate}::uumain, {krate}::uu_app_b3sum)");
76-
phf_map.entry("md5sum", &map_value);
77-
phf_map.entry("sha1sum", &map_value);
78-
phf_map.entry("sha224sum", &map_value);
79-
phf_map.entry("sha256sum", &map_value);
80-
phf_map.entry("sha384sum", &map_value);
81-
phf_map.entry("sha512sum", &map_value);
82-
phf_map.entry("sha3sum", &map_value_bits);
83-
phf_map.entry("sha3-224sum", &map_value);
84-
phf_map.entry("sha3-256sum", &map_value);
85-
phf_map.entry("sha3-384sum", &map_value);
86-
phf_map.entry("sha3-512sum", &map_value);
87-
phf_map.entry("shake128sum", &map_value_bits);
88-
phf_map.entry("shake256sum", &map_value_bits);
89-
phf_map.entry("b2sum", &map_value);
90-
phf_map.entry("b3sum", &map_value_b3sum);
91-
}
92-
_ => {
93-
phf_map.entry(krate, &map_value);
94-
}
95-
}
56+
phf_map.entry(krate, &map_value);
9657
}
9758
write!(mf, "{}", phf_map.build()).unwrap();
9859
mf.write_all(b"\n}\n").unwrap();

0 commit comments

Comments
 (0)