Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 4, 2024

Conversation

lcheylus
Copy link
Contributor

@lcheylus lcheylus commented May 1, 2024

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 #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

@BenWiederhake
Copy link
Collaborator

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.

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

- with cargo v1.76, id = "coreutils 0.0.26 (path+file://<coreutils local directory>)"
- with cargo v1.77, id = "path+file://<coreutils local directory>#[email protected]"

Fix uutils#6242

Signed-off-by: Laurent Cheylus <[email protected]>
@lcheylus
Copy link
Contributor Author

lcheylus commented May 4, 2024

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.

Copy link
Collaborator

@BenWiederhake BenWiederhake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

Copy link

github-actions bot commented May 4, 2024

GNU testsuite comparison:

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

@BenWiederhake
Copy link
Collaborator

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

@BenWiederhake BenWiederhake merged commit 3b96ff1 into uutils:main May 4, 2024
69 of 70 checks passed
@lcheylus lcheylus deleted the show-utils branch May 4, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error with util/show-utils.sh script if main directory != coreutils
2 participants