coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: change cksum -b to allow full emulation of older utils


From: Pádraig Brady
Subject: Re: RFC: change cksum -b to allow full emulation of older utils
Date: Sat, 8 Jul 2023 21:58:28 +0100
User-agent: Mozilla Thunderbird

On 08/07/2023 19:52, Jim Meyering wrote:
On Sat, Jul 8, 2023 at 7:28 AM Pádraig Brady <P@draigbrady.com> wrote:
It would be nice to be able to support users who want to replace all
the *sum utilities with a script that did:

    exec cksum -a <algo> --untagged "$@"

To that end, it would be good to support all the options of the older utils.
This is a bit awkward with --base64 added in the last few months, as that
also added the short -b option.  However it's only a few months released,
so it's probably not too onerous to change.

The attached makes the change, which I'll augment with NEWS and tests/ upon 
agreement.

Good idea. I agree that the added value outweighs the cost of
divergence with OpenBSD cksum's -b (https://man.openbsd.org/cksum.1)

Oh right. Though all OpenBSD's cksum options are not supported
so we don't have to worry too much about direct compat here.

One nit: the in-comment reference to -b needs to say --base64, too (in
tests/cksum/cksum-base64.pl):

     # Ensure that each of the above works with -b:
     (map {my ($h,$v)= @$_; my $o=fmt $h,$v;
-         [$h, "-ba $h", {IN=>{f=>''}}, {OUT=>"$o\n"}]} @pairs),
+         [$h, "--base64 -a $h", {IN=>{f=>''}}, {OUT=>"$o\n"}]} @pairs),

Latest patch attached.

thanks for the review.

Pádraig

Attachment: cksum-emulate.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]