Skip to content

Commit 14cf09d

Browse files
committed
md5sum: introduce standalone binary
1 parent a78a9db commit 14cf09d

File tree

18 files changed

+910
-8
lines changed

18 files changed

+910
-8
lines changed

Cargo.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ feat_common_core = [
8080
"basenc",
8181
"cat",
8282
"cksum",
83+
"md5sum",
8384
"comm",
8485
"cp",
8586
"csplit",
@@ -437,6 +438,7 @@ chmod = { optional = true, version = "0.5.0", package = "uu_chmod", path = "src/
437438
chown = { optional = true, version = "0.5.0", package = "uu_chown", path = "src/uu/chown" }
438439
chroot = { optional = true, version = "0.5.0", package = "uu_chroot", path = "src/uu/chroot" }
439440
cksum = { optional = true, version = "0.5.0", package = "uu_cksum", path = "src/uu/cksum" }
441+
md5sum = { optional = true, version = "0.5.0", package = "uu_md5sum", path = "src/uu/md5sum" }
440442
comm = { optional = true, version = "0.5.0", package = "uu_comm", path = "src/uu/comm" }
441443
cp = { optional = true, version = "0.5.0", package = "uu_cp", path = "src/uu/cp" }
442444
csplit = { optional = true, version = "0.5.0", package = "uu_csplit", path = "src/uu/csplit" }

GNUmakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ PROGS := \
8484
basename \
8585
cat \
8686
cksum \
87+
md5sum \
8788
comm \
8889
cp \
8990
csplit \
@@ -186,7 +187,6 @@ SELINUX_PROGS := \
186187

187188
HASHSUM_PROGS := \
188189
b2sum \
189-
md5sum \
190190
sha1sum \
191191
sha224sum \
192192
sha256sum \
@@ -223,6 +223,7 @@ TEST_PROGS := \
223223
chmod \
224224
chown \
225225
cksum \
226+
md5sum \
226227
comm \
227228
cp \
228229
csplit \

build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ pub fn main() {
7979
phf_map.entry(krate, format!("({krate}::uumain, {krate}::uu_app_custom)"));
8080

8181
let map_value = format!("({krate}::uumain, {krate}::uu_app_common)");
82-
phf_map.entry("md5sum", map_value.clone());
8382
phf_map.entry("sha1sum", map_value.clone());
8483
phf_map.entry("sha224sum", map_value.clone());
8584
phf_map.entry("sha256sum", map_value.clone());

src/common/validation.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn get_canonical_util_name(util_name: &str) -> &str {
5151
"[" => "test",
5252

5353
// hashsum aliases - all these hash commands are aliases for hashsum
54-
"md5sum" | "sha1sum" | "sha224sum" | "sha256sum" | "sha384sum" | "sha512sum" | "b2sum" => {
54+
"sha1sum" | "sha224sum" | "sha256sum" | "sha384sum" | "sha512sum" | "b2sum" => {
5555
"hashsum"
5656
}
5757

@@ -98,7 +98,6 @@ mod tests {
9898
fn test_get_canonical_util_name() {
9999
// Test a few key aliases
100100
assert_eq!(get_canonical_util_name("["), "test");
101-
assert_eq!(get_canonical_util_name("md5sum"), "hashsum");
102101
assert_eq!(get_canonical_util_name("dir"), "ls");
103102

104103
// Test passthrough case

src/uu/md5sum/Cargo.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[package]
2+
name = "uu_md5sum"
3+
description = "md5sum ~ (uutils) Print or check the BLAKE2b checksums"
4+
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/md5sum"
5+
version.workspace = true
6+
authors.workspace = true
7+
license.workspace = true
8+
homepage.workspace = true
9+
keywords.workspace = true
10+
categories.workspace = true
11+
edition.workspace = true
12+
readme.workspace = true
13+
14+
[lints]
15+
workspace = true
16+
17+
[lib]
18+
path = "src/md5sum.rs"
19+
20+
[dependencies]
21+
clap = { workspace = true }
22+
uu_checksum_common = { workspace = true }
23+
uucore = { workspace = true, features = [
24+
"checksum",
25+
"encoding",
26+
"sum",
27+
"hardware",
28+
] }
29+
fluent = { workspace = true }
30+
31+
[dev-dependencies]
32+
divan = { workspace = true }
33+
tempfile = { workspace = true }
34+
uucore = { workspace = true, features = ["benchmark"] }
35+
36+
[[bin]]
37+
name = "md5sum"
38+
path = "src/main.rs"
39+
40+
# [[bench]]
41+
# name = "b2sum_bench"
42+
# harness = false

src/uu/md5sum/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../LICENSE

src/uu/md5sum/locales/en-US.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
md5sum-about = Print or check the MD5 checksums
2+
md5sum-usage = md5sum [OPTIONS] [FILE]...
3+
md5sum-after-help = With no FILE or when FILE is -, read standard input

src/uu/md5sum/locales/fr-FR.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
md5sum-about = Afficher le MD5 et la taille de chaque fichier
2+
md5sum-usage = md5sum [OPTION]... [FICHIER]...

src/uu/md5sum/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uucore::bin!(uu_md5sum);

0 commit comments

Comments
 (0)