Skip to content

Commit fc4ea59

Browse files
committed
sha512sum: introduce standalone binary
1 parent 662e7b5 commit fc4ea59

19 files changed

Lines changed: 221 additions & 13 deletions

File tree

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
@@ -92,6 +92,7 @@ feat_common_core = [
9292
"sha224sum",
9393
"sha256sum",
9494
"sha384sum",
95+
"sha512sum",
9596
"comm",
9697
"cp",
9798
"csplit",
@@ -446,6 +447,7 @@ sha1sum = { optional = true, version = "0.5.0", package = "uu_sha1sum", path = "
446447
sha224sum = { optional = true, version = "0.5.0", package = "uu_sha224sum", path = "src/uu/sha224sum" }
447448
sha256sum = { optional = true, version = "0.5.0", package = "uu_sha256sum", path = "src/uu/sha256sum" }
448449
sha384sum = { optional = true, version = "0.5.0", package = "uu_sha384sum", path = "src/uu/sha384sum" }
450+
sha512sum = { optional = true, version = "0.5.0", package = "uu_sha512sum", path = "src/uu/sha512sum" }
449451
comm = { optional = true, version = "0.5.0", package = "uu_comm", path = "src/uu/comm" }
450452
cp = { optional = true, version = "0.5.0", package = "uu_cp", path = "src/uu/cp" }
451453
csplit = { optional = true, version = "0.5.0", package = "uu_csplit", path = "src/uu/csplit" }

GNUmakefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ PROGS := \
9090
sha224sum \
9191
sha256sum \
9292
sha384sum \
93+
sha512sum \
9394
comm \
9495
cp \
9596
csplit \
@@ -190,9 +191,6 @@ SELINUX_PROGS := \
190191
chcon \
191192
runcon
192193

193-
HASHSUM_PROGS := \
194-
sha512sum
195-
196194
$(info Detected OS = $(OS))
197195

198196
ifeq (,$(findstring MINGW,$(OS)))
@@ -229,6 +227,7 @@ TEST_PROGS := \
229227
sha224sum \
230228
sha256sum \
231229
sha384sum \
230+
sha512sum \
232231
comm \
233232
cp \
234233
csplit \

build.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ pub fn main() {
7777
}
7878
"hashsum" => {
7979
phf_map.entry(krate, format!("({krate}::uumain, {krate}::uu_app_custom)"));
80-
81-
let map_value = format!("({krate}::uumain, {krate}::uu_app_common)");
82-
phf_map.entry("sha512sum", map_value.clone());
8380
}
8481
_ => {
8582
phf_map.entry(krate, map_value.clone());

src/common/validation.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ fn get_canonical_util_name(util_name: &str) -> &str {
5050
// uu_test aliases - '[' is an alias for test
5151
"[" => "test",
5252

53-
// hashsum aliases - all these hash commands are aliases for hashsum
54-
"sha512sum" => "hashsum",
55-
5653
"dir" => "ls", // dir is an alias for ls
5754

5855
// Default case - return the util name as is

src/uu/sha512sum/Cargo.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[package]
2+
name = "uu_sha512sum"
3+
description = "sha512sum ~ (uutils) Print or check the SHA512 checksums"
4+
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/sha512sum"
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/sha512sum.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 = "sha512sum"
38+
path = "src/main.rs"

src/uu/sha512sum/LICENSE

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sha512sum-about = Print or check the SHA512 checksums
2+
sha512sum-usage = sha512sum [OPTIONS] [FILE]...

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

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

src/uu/sha512sum/src/main.rs

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

0 commit comments

Comments
 (0)