From d918da428de4185afb22de7e4567c1e3c3edf8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 8 Oct 2025 18:51:13 +0100 Subject: [PATCH 1/3] feat(coreutils): update for newer GNU coreutils Adjust for changes in GNU coreutils. Valid as of coreutils 9.5 (Mar 2024). Add completions for: base32, basenc, cksum, comm, numfmt, readlink, realpath, shred, shuf, stat, sync Adjust completions for: chgrp: add --from dd: remove deprecated *_bytes flags --- bash_completion | 7 ++++--- completions/chgrp | 2 +- completions/dd | 3 +-- completions/sha256sum | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bash_completion b/bash_completion index 9cedadfac78..95b7ede0104 100644 --- a/bash_completion +++ b/bash_completion @@ -3150,11 +3150,12 @@ _comp_complete_longopt() } # makeinfo and texi2dvi are defined elsewhere. complete -F _comp_complete_longopt \ - a2ps awk base64 bash bc bison cat chroot colordiff cp \ + a2ps awk base{32,64,nc} bash bc bison cat chroot colordiff comm cp \ csplit cut date df diff dir du enscript expand fmt fold gperf \ grep grub head irb ld ldd less ln ls m4 mkdir mkfifo mknod \ - mv netstat nl nm objcopy objdump od paste pr ptx readelf rm rmdir \ - sed seq shar sort split strip sum tac tail tee \ + mv netstat nl nm numfmt objcopy objdump od paste pr ptx readelf \ + readlink realpath rm rmdir sed seq shar shred \ + shuf sort split stat strip sum sync tac tail tee \ texindex touch tr uname unexpand uniq units vdir wc who # @since 2.12 diff --git a/completions/chgrp b/completions/chgrp index 1e19750c2d4..a8cf9ce2878 100644 --- a/completions/chgrp +++ b/completions/chgrp @@ -20,7 +20,7 @@ _comp_cmd_chgrp() for w in "${words[@]}"; do [[ $w == -@(R|-recursive) ]] && opts="-H -L -P" && break done - _comp_compgen -- -W '-c -h -f -R -v --changes --dereference + _comp_compgen -- -W '-c -h -f -R -v --changes --dereference --from --no-dereference --silent --quiet --reference --recursive --verbose --help --version $opts' return diff --git a/completions/dd b/completions/dd index a9985b1e1eb..18264c1391d 100644 --- a/completions/dd +++ b/completions/dd @@ -18,8 +18,7 @@ _comp_cmd_dd() ;; iflag=* | oflag=*) _comp_compgen -c "${cur#*=}" -- -W 'append direct directory dsync - sync fullblock nonblock noatime nocache noctty nofollow - count_bytes skip_bytes seek_bytes' + sync fullblock nonblock noatime nocache noctty nofollow' return ;; status=*) diff --git a/completions/sha256sum b/completions/sha256sum index adef1cd4a8c..3f4403e5674 100644 --- a/completions/sha256sum +++ b/completions/sha256sum @@ -33,6 +33,7 @@ _comp_cmd_sha256sum() _comp_compgen -v files filedir && _comp_compgen -- -X "*.$sumtype" -W '"${files[@]}"' } && - complete -F _comp_cmd_sha256sum b2sum md5sum sha{,1,224,256,384,512}sum + complete -F _comp_cmd_sha256sum b2sum cksum md5sum \ + sha{,1,224,256,384,512}sum # ex: filetype=sh From 1a4acef7726d4b67b55d070bb37786d5e8de973d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Oct 2025 10:41:11 +0300 Subject: [PATCH 2/3] test: add basic tests for added completions --- test/t/Makefile.am | 11 +++++++++++ test/t/test_base32.py | 11 +++++++++++ test/t/test_basenc.py | 11 +++++++++++ test/t/test_cksum.py | 11 +++++++++++ test/t/test_comm.py | 11 +++++++++++ test/t/test_numfmt.py | 11 +++++++++++ test/t/test_readlink.py | 11 +++++++++++ test/t/test_realpath.py | 11 +++++++++++ test/t/test_shred.py | 11 +++++++++++ test/t/test_shuf.py | 11 +++++++++++ test/t/test_stat.py | 11 +++++++++++ test/t/test_sync.py | 11 +++++++++++ test/test-cmd-list.txt | 11 +++++++++++ 13 files changed, 143 insertions(+) create mode 100644 test/t/test_base32.py create mode 100644 test/t/test_basenc.py create mode 100644 test/t/test_cksum.py create mode 100644 test/t/test_comm.py create mode 100644 test/t/test_numfmt.py create mode 100644 test/t/test_readlink.py create mode 100644 test/t/test_realpath.py create mode 100644 test/t/test_shred.py create mode 100644 test/t/test_shuf.py create mode 100644 test/t/test_stat.py create mode 100644 test/t/test_sync.py diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 7ed95e424fa..d8a72b115bf 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -42,7 +42,9 @@ EXTRA_DIST = \ test_awk.py \ test_b2sum.py \ test_badblocks.py \ + test_base32.py \ test_base64.py \ + test_basenc.py \ test_bash.py \ test_bc.py \ test_bind.py \ @@ -90,11 +92,13 @@ EXTRA_DIST = \ test_civclient.py \ test_civserver.py \ test_cksfv.py \ + test_cksum.py \ test_cleanarch.py \ test_clisp.py \ test_clone_member.py \ test_co.py \ test_colordiff.py \ + test_comm.py \ test_compare.py \ test_compgen.py \ test_complete.py \ @@ -427,6 +431,7 @@ EXTRA_DIST = \ test_nslookup.py \ test_nsupdate.py \ test_ntpdate.py \ + test_numfmt.py \ test_objcopy.py \ test_objdump.py \ test_od.py \ @@ -521,7 +526,9 @@ EXTRA_DIST = \ test_rdesktop.py \ test_rdict.py \ test_readelf.py \ + test_readlink.py \ test_readonly.py \ + test_realpath.py \ test_remove_members.py \ test_removepkg.py \ test_renice.py \ @@ -568,7 +575,9 @@ EXTRA_DIST = \ test_sha512sum.py \ test_shar.py \ test_shellcheck.py \ + test_shred.py \ test_shtab.py \ + test_shuf.py \ test_sitecopy.py \ test_slabtop.py \ test_slackpkg.py \ @@ -596,6 +605,7 @@ EXTRA_DIST = \ test_sshfs.py \ test_sshmitm.py \ test_sshow.py \ + test_stat.py \ test_strace.py \ test_stream.py \ test_strings.py \ @@ -608,6 +618,7 @@ EXTRA_DIST = \ test_svn.py \ test_svnadmin.py \ test_svnlook.py \ + test_sync.py \ test_sync_members.py \ test_synclient.py \ test_sysbench.py \ diff --git a/test/t/test_base32.py b/test/t/test_base32.py new file mode 100644 index 00000000000..a32f3e03a85 --- /dev/null +++ b/test/t/test_base32.py @@ -0,0 +1,11 @@ +import pytest + + +class TestBase32: + @pytest.mark.complete("base32 ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("base32 -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_basenc.py b/test/t/test_basenc.py new file mode 100644 index 00000000000..bf66282c74e --- /dev/null +++ b/test/t/test_basenc.py @@ -0,0 +1,11 @@ +import pytest + + +class TestBasenc: + @pytest.mark.complete("basenc ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("basenc -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_cksum.py b/test/t/test_cksum.py new file mode 100644 index 00000000000..9c9bec06652 --- /dev/null +++ b/test/t/test_cksum.py @@ -0,0 +1,11 @@ +import pytest + + +class TestCksum: + @pytest.mark.complete("cksum ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("cksum -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_comm.py b/test/t/test_comm.py new file mode 100644 index 00000000000..3131ad63160 --- /dev/null +++ b/test/t/test_comm.py @@ -0,0 +1,11 @@ +import pytest + + +class TestComm: + @pytest.mark.complete("comm ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("comm -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_numfmt.py b/test/t/test_numfmt.py new file mode 100644 index 00000000000..64bdf60e048 --- /dev/null +++ b/test/t/test_numfmt.py @@ -0,0 +1,11 @@ +import pytest + + +class TestNumfmt: + @pytest.mark.complete("numfmt ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("numfmt -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_readlink.py b/test/t/test_readlink.py new file mode 100644 index 00000000000..f76d99e9476 --- /dev/null +++ b/test/t/test_readlink.py @@ -0,0 +1,11 @@ +import pytest + + +class TestReadlink: + @pytest.mark.complete("readlink ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("readlink -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_realpath.py b/test/t/test_realpath.py new file mode 100644 index 00000000000..62752858b85 --- /dev/null +++ b/test/t/test_realpath.py @@ -0,0 +1,11 @@ +import pytest + + +class TestRealpath: + @pytest.mark.complete("realpath ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("realpath -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_shred.py b/test/t/test_shred.py new file mode 100644 index 00000000000..49203c8f821 --- /dev/null +++ b/test/t/test_shred.py @@ -0,0 +1,11 @@ +import pytest + + +class TestShred: + @pytest.mark.complete("shred ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("shred -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_shuf.py b/test/t/test_shuf.py new file mode 100644 index 00000000000..215ff32aadb --- /dev/null +++ b/test/t/test_shuf.py @@ -0,0 +1,11 @@ +import pytest + + +class TestShuf: + @pytest.mark.complete("shuf ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("shuf -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_stat.py b/test/t/test_stat.py new file mode 100644 index 00000000000..5574a484789 --- /dev/null +++ b/test/t/test_stat.py @@ -0,0 +1,11 @@ +import pytest + + +class TestStat: + @pytest.mark.complete("stat ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("stat -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_sync.py b/test/t/test_sync.py new file mode 100644 index 00000000000..02962d390f4 --- /dev/null +++ b/test/t/test_sync.py @@ -0,0 +1,11 @@ +import pytest + + +class TestSync: + @pytest.mark.complete("sync ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("sync -", require_longopt=True) + def test_options(self, completion): + assert completion diff --git a/test/test-cmd-list.txt b/test/test-cmd-list.txt index 0188f18603c..4a0923e1230 100644 --- a/test/test-cmd-list.txt +++ b/test/test-cmd-list.txt @@ -23,7 +23,9 @@ avahi-browse awk b2sum badblocks +base32 base64 +basenc bash bc bind @@ -46,7 +48,9 @@ chsh civclient civserver cksfv +cksum colordiff +comm configure convert cp @@ -250,6 +254,7 @@ nmap nproc nsupdate ntpdate +numfmt objcopy od oggdec @@ -320,6 +325,8 @@ radvdump rdesktop rdict readelf +readlink +realpath repomanage reportbug reptyr @@ -346,7 +353,9 @@ sha384sum sha512sum shar shellcheck +shred shtab +shuf sitecopy slabtop slapt-get @@ -371,12 +380,14 @@ ssh-keygen ssh-keyscan sshmitm sshow +stat strace strings strip su sudo sum +sync synclient sysbench sysctl From 64685d8487c84b0814f6b6caff14b594f62fdcf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Oct 2025 10:41:39 +0300 Subject: [PATCH 3/3] fix(cksum): symlink to sha256sum --- completions/.gitignore | 1 + completions/Makefile.am | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/completions/.gitignore b/completions/.gitignore index 332ce27dda4..55396b5f13b 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -59,6 +59,7 @@ /ciptool /civclient /civserver +/cksum /_cloudquery /_clusterctl /clzip diff --git a/completions/Makefile.am b/completions/Makefile.am index 2ff5e603720..10e6ed9c22c 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -620,6 +620,7 @@ CLEANFILES = \ ciptool \ civclient \ civserver \ + cksum \ _cloudquery \ _clusterctl \ clzip \ @@ -1493,7 +1494,7 @@ endif $(ss) sbcl \ sbcl-mt $(ss) sha256sum \ - b2sum md5sum shasum sha1sum sha224sum sha384sum sha512sum + b2sum cksum md5sum shasum sha1sum sha224sum sha384sum sha512sum $(ss) _sops \ _kata-runtime _todoist $(ss) ssh \