Skip to content

Commit 4b16fc9

Browse files
author
oech3
committed
cksum: Replace hashsum with cksum symlinks
1 parent 130f780 commit 4b16fc9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+129
-1939
lines changed

.github/workflows/CICD.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ jobs:
287287
mv -T target target.cache
288288
fi
289289
# Check that we don't cross-build uudoc
290-
# also do not try to generate manpages for part of hashsum
290+
# also do not try to generate manpages for part of cksum
291291
make install-manpages PREFIX=/tmp/usr UTILS=true RUSTC_ARCH="--target aarch64-unknown-linux-gnu"
292292
# build (host)
293293
make build
@@ -352,8 +352,8 @@ jobs:
352352
set -x
353353
DESTDIR=/tmp/ make PROFILE=release MULTICALL=n install
354354
# Check that the utils are present
355-
test -f /tmp/usr/local/bin/hashsum
356-
# Check that hashsum symlinks are present
355+
test -f /tmp/usr/local/bin/cksum
356+
# Check that cksum symlinks are present
357357
test -h /tmp/usr/local/bin/b2sum
358358
test -h /tmp/usr/local/bin/md5sum
359359
test -h /tmp/usr/local/bin/sha1sum
@@ -366,7 +366,7 @@ jobs:
366366
run: |
367367
set -x
368368
DESTDIR=/tmp/ make PROFILE=release MULTICALL=y LN="ln -svf" install
369-
# Check that relative symlinks of hashsum are present
369+
# Check that relative symlinks of cksum are present
370370
[ $(readlink /tmp/usr/local/bin/b2sum) = coreutils ]
371371
[ $(readlink /tmp/usr/local/bin/md5sum) = coreutils ]
372372
[ $(readlink /tmp/usr/local/bin/sha512sum) = coreutils ]

.vscode/cspell.dictionaries/jargon.wordlist.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ hardfloat
7272
hardlink
7373
hardlinks
7474
hasher
75-
hashsums
7675
hwcaps
7776
infile
7877
iflag

.vscode/cspell.dictionaries/workspace.wordlist.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ chroot
101101
cksum
102102
csplit
103103
dircolors
104-
hashsum
105104
hostid
106105
logname
107106
mkdir

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ feat_common_core = [
9999
"false",
100100
"fmt",
101101
"fold",
102-
"hashsum",
103102
"head",
104103
"join",
105104
"link",
@@ -456,7 +455,6 @@ false = { optional = true, version = "0.5.0", package = "uu_false", path = "src/
456455
fmt = { optional = true, version = "0.5.0", package = "uu_fmt", path = "src/uu/fmt" }
457456
fold = { optional = true, version = "0.5.0", package = "uu_fold", path = "src/uu/fold" }
458457
groups = { optional = true, version = "0.5.0", package = "uu_groups", path = "src/uu/groups" }
459-
hashsum = { optional = true, version = "0.5.0", package = "uu_hashsum", path = "src/uu/hashsum" }
460458
head = { optional = true, version = "0.5.0", package = "uu_head", path = "src/uu/head" }
461459
hostid = { optional = true, version = "0.5.0", package = "uu_hostid", path = "src/uu/hostid" }
462460
hostname = { optional = true, version = "0.5.0", package = "uu_hostname", path = "src/uu/hostname" }

GNUmakefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ PROGS := \
103103
false \
104104
fmt \
105105
fold \
106-
hashsum \
107106
head \
108107
hostname \
109108
join \
@@ -184,7 +183,7 @@ SELINUX_PROGS := \
184183
chcon \
185184
runcon
186185

187-
HASHSUM_PROGS := \
186+
CKSUM_PROGS := \
188187
b2sum \
189188
md5sum \
190189
sha1sum \
@@ -203,8 +202,8 @@ ifeq ($(SELINUX_ENABLED),1)
203202
endif
204203

205204
UTILS ?= $(filter-out $(SKIP_UTILS),$(PROGS))
206-
ifneq ($(filter hashsum,$(UTILS)),hashsum)
207-
HASHSUM_PROGS :=
205+
ifneq ($(filter cksum,$(UTILS)),cksum)
206+
CKSUM_PROGS :=
208207
endif
209208

210209
ifneq ($(findstring stdbuf,$(UTILS)),)
@@ -236,7 +235,6 @@ TEST_PROGS := \
236235
factor \
237236
false \
238237
fold \
239-
hashsum \
240238
head \
241239
install \
242240
link \
@@ -386,7 +384,7 @@ build-uudoc:
386384

387385
install-manpages: build-uudoc
388386
mkdir -p $(DESTDIR)$(DATAROOTDIR)/man/man1
389-
$(foreach prog, $(INSTALLEES) $(HASHSUM_PROGS), \
387+
$(foreach prog, $(INSTALLEES) $(CKSUM_PROGS), \
390388
$(BUILDDIR)/uudoc manpage $(prog) > $(DESTDIR)$(DATAROOTDIR)/man/man1/$(PROG_PREFIX)$(prog).1 $(newline) \
391389
)
392390
else
@@ -399,7 +397,7 @@ install-completions: build-uudoc
399397
mkdir -p $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions
400398
mkdir -p $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions
401399
mkdir -p $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d
402-
$(foreach prog, $(INSTALLEES) $(HASHSUM_PROGS) , \
400+
$(foreach prog, $(INSTALLEES) $(CKSUM_PROGS), \
403401
$(BUILDDIR)/uudoc completion $(prog) zsh > $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions/_$(PROG_PREFIX)$(prog) $(newline) \
404402
$(BUILDDIR)/uudoc completion $(prog) bash > $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions/$(PROG_PREFIX)$(prog).bash $(newline) \
405403
$(BUILDDIR)/uudoc completion $(prog) fish > $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d/$(PROG_PREFIX)$(prog).fish $(newline) \
@@ -461,16 +459,16 @@ ifeq (${MULTICALL}, y)
461459
$(foreach prog, $(filter-out coreutils, $(INSTALLEES)), \
462460
cd $(INSTALLDIR_BIN) && $(LN) $(PROG_PREFIX)coreutils $(PROG_PREFIX)$(prog) $(newline) \
463461
)
464-
$(foreach prog, $(HASHSUM_PROGS), \
462+
$(foreach prog, $(CKSUM_PROGS), \
465463
cd $(INSTALLDIR_BIN) && $(LN) $(PROG_PREFIX)coreutils $(PROG_PREFIX)$(prog) $(newline) \
466464
)
467465
$(if $(findstring test,$(INSTALLEES)), cd $(INSTALLDIR_BIN) && $(LN) $(PROG_PREFIX)coreutils $(PROG_PREFIX)[)
468466
else
469467
$(foreach prog, $(INSTALLEES), \
470468
$(INSTALL) -m 755 $(BUILDDIR)/$(prog) $(INSTALLDIR_BIN)/$(PROG_PREFIX)$(prog) $(newline) \
471469
)
472-
$(foreach prog, $(HASHSUM_PROGS), \
473-
cd $(INSTALLDIR_BIN) && $(LN) $(PROG_PREFIX)hashsum $(PROG_PREFIX)$(prog) $(newline) \
470+
$(foreach prog, $(CKSUM_PROGS), \
471+
cd $(INSTALLDIR_BIN) && $(LN) $(PROG_PREFIX)cksum $(PROG_PREFIX)$(prog) $(newline) \
474472
)
475473
$(if $(findstring test,$(INSTALLEES)), $(INSTALL) -m 755 $(BUILDDIR)/test $(INSTALLDIR_BIN)/$(PROG_PREFIX)[)
476474
endif

build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ pub fn main() {
7575
"false" | "true" => {
7676
phf_map.entry(krate, format!("(r#{krate}::uumain, r#{krate}::uu_app)"));
7777
}
78-
"hashsum" => {
79-
phf_map.entry(krate, format!("({krate}::uumain, {krate}::uu_app_custom)"));
78+
"cksum" => {
79+
phf_map.entry(krate, format!("({krate}::uumain, {krate}::uu_app)"));
8080

81-
let map_value = format!("({krate}::uumain, {krate}::uu_app_common)");
81+
let map_value = format!("({krate}::uumain, {krate}::uu_app)");
8282
phf_map.entry("md5sum", map_value.clone());
8383
phf_map.entry("sha1sum", map_value.clone());
8484
phf_map.entry("sha224sum", map_value.clone());

docs/compiles_table.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
target,arch,base32,base64,basename,cat,chgrp,chmod,chown,chroot,cksum,comm,cp,csplit,cut,date,df,dircolors,dirname,du,echo,env,expand,expr,factor,false,fmt,fold,groups,hashsum,head,hostid,hostname,id,install,join,kill,link,ln,logname,ls,mkdir,mkfifo,mknod,mktemp,more,mv,nice,nl,nohup,nproc,numfmt,od,paste,pathchk,pinky,printenv,printf,ptx,pwd,readlink,realpath,rm,rmdir,seq,shred,shuf,sleep,sort,split,stat,stdbuf,sum,sync,tac,tail,tee,test,timeout,touch,tr,true,truncate,tsort,tty,uname,unexpand,uniq,unlink,uptime,users,wc,who,whoami,yes,chcon,pr,dir,vdir,dd,basenc,runcon
1+
target,arch,base32,base64,basename,cat,chgrp,chmod,chown,chroot,cksum,comm,cp,csplit,cut,date,df,dircolors,dirname,du,echo,env,expand,expr,factor,false,fmt,fold,groups,head,hostid,hostname,id,install,join,kill,link,ln,logname,ls,mkdir,mkfifo,mknod,mktemp,more,mv,nice,nl,nohup,nproc,numfmt,od,paste,pathchk,pinky,printenv,printf,ptx,pwd,readlink,realpath,rm,rmdir,seq,shred,shuf,sleep,sort,split,stat,stdbuf,sum,sync,tac,tail,tee,test,timeout,touch,tr,true,truncate,tsort,tty,uname,unexpand,uniq,unlink,uptime,users,wc,who,whoami,yes,chcon,pr,dir,vdir,dd,basenc,runcon
22
aarch64-unknown-linux-gnu,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
33
i686-unknown-linux-gnu,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
44
powerpc64-unknown-linux-gnu,0,0,0,0,0,0,0,0,0,0,0,101,0,0,0,0,0,0,0,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

docs/src/extensions.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ packages.
4747

4848
`rm` can display a progress bar when the `-g`/`--progress` flag is set.
4949

50-
## `hashsum` (deprecated)
51-
52-
This utility does not exist in GNU coreutils. `hashsum` is a utility that
53-
supports computing the checksums with several algorithms. The flags and options
54-
are identical to the `*sum` family of utils (`sha1sum`, `sha256sum`, `b2sum`,
55-
etc.). This utility will be removed in the future and it is advised to use `cksum --untagged` instead.
56-
5750
## `more`
5851

5952
We provide a simple implementation of `more`, which is not part of GNU

fuzz/fuzz_targets/fuzz_non_utf8_paths.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ static PATH_PROGRAMS: &[&str] = &[
8383
"vdir",
8484
"mkfifo",
8585
"mknod",
86-
"hashsum",
8786
// File I/O utilities
8887
"dd",
8988
"sync",
@@ -252,12 +251,6 @@ fn test_program_with_non_utf8_path(program: &str, path: &PathBuf) -> CommandResu
252251
OsString::from("bs=1"),
253252
OsString::from("count=1"),
254253
],
255-
// Hashsum needs algorithm
256-
"hashsum" => vec![
257-
OsString::from(program),
258-
OsString::from("--md5"),
259-
path_os.to_owned(),
260-
],
261254
// Encoding/decoding programs
262255
"base32" | "base64" | "basenc" => vec![OsString::from(program), path_os.to_owned()],
263256
"df" => vec![OsString::from(program), path_os.to_owned()],

src/common/validation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ 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
53+
// cksum aliases - all these hash commands are aliases for cksum
5454
"md5sum" | "sha1sum" | "sha224sum" | "sha256sum" | "sha384sum" | "sha512sum" | "b2sum" => {
55-
"hashsum"
55+
"cksum"
5656
}
5757

5858
"dir" => "ls", // dir is an alias for ls
@@ -98,7 +98,7 @@ 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");
101+
assert_eq!(get_canonical_util_name("md5sum"), "cksum");
102102
assert_eq!(get_canonical_util_name("dir"), "ls");
103103

104104
// Test passthrough case

0 commit comments

Comments
 (0)