coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

show-utils.sh: fix jq query to get coreutils deps

Open lcheylus opened this issue 1 year ago • 1 comments

In jq query, the correct regex to select .id is ".*#coreutils[ |@]\d+\.\d+\.\d+"

  • with cargo v1.76.0, id = coreutils 0.0.26 (path+file://<coreutils local directory>)
  • with cargo v1.77.0, id = path+file://<coreutils local directory>#[email protected]

Fix uutils/coreutils#6242


Tests OK on OpenBSD with cargo v1.76 and FreeBSD with cargo v1.77

$ ./util/show-utils.sh
base32 base64 basename basenc cat cksum comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false fmt fold hashsum head join link ln ls mkdir mktemp more mv nl numfmt od paste pr printenv printf ptx pwd readlink realpath rm rmdir seq shred shuf sleep sort split sum tac tail tee test touch tr true truncate tsort unexpand uniq unlink vdir wc yes

$ ./util/show-utils.sh --no-default-features --features "unix"
arch base32 base64 basename basenc cat chgrp chmod chown chroot cksum comm cp csplit cut date dd df dir 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 pr printenv printf ptx pwd readlink realpath rm rmdir seq shred shuf sleep sort split stat stdbuf stty sum sync tac tail tee test timeout touch tr true truncate tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes

lcheylus avatar May 01 '24 08:05 lcheylus

You say that on cargo 1.76.0, id is something like coreutils 0.0.26 (path+file://<coreutils local directory>), which does not contain a pound/hash/octothorpe/# at all, yet the regex requires it. So I would expect that it doesn't work. Why does it work?

Also, I have a feeling that this regex has been "fixed" more than once in the past, could you add some concrete examples of strings that the regex needs to match, as a comment? This would provide some light assurance that we don't regress when the next "fix" lands.

BenWiederhake avatar May 01 '24 15:05 BenWiederhake

Sorry I have made an error in my first commit message : the correct regex to select coreutils is is ".*coreutils[ |@]\d+\.\d+\.\d+" (without # hash/pound).

I have pushed a new version of my fix + comments for the different outputs or cargo metadata to find coreutils id with jq / regex.

lcheylus avatar May 04 '24 15:05 lcheylus

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar May 04 '24 15:05 github-actions[bot]

Remaining failures are #6275 and #6333, which is out-of-scope for this PR.

BenWiederhake avatar May 04 '24 16:05 BenWiederhake