diff options
author | Laurent Cheylus <foxy@free.fr> | 2024-05-01 10:40:50 +0200 |
---|---|---|
committer | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2024-05-04 18:20:03 +0200 |
commit | 3b96ff1d10a4d74e7018c6a84474de75d168136c (patch) | |
tree | dda992758ddcd65314a3211f96d47e1c4b4a6e64 | |
parent | 99d234af87698c23de1ab9562552ccd918165b39 (diff) |
show-utils.sh: fix jq query to get coreutils deps
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>#coreutils@0.0.26"
Fix uutils/coreutils#6242
Signed-off-by: Laurent Cheylus <foxy@free.fr>
-rwxr-xr-x | util/show-utils.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/util/show-utils.sh b/util/show-utils.sh index 834c3b8f9..3de0a6df4 100755 --- a/util/show-utils.sh +++ b/util/show-utils.sh @@ -33,5 +33,8 @@ cd "${project_main_dir}" && echo "WARN: missing \`jq\` (install with \`sudo apt install jq\`); falling back to default (only fully cross-platform) utility list" 1>&2 echo "$default_utils" else - cargo metadata "$@" --format-version 1 | jq -r '[.resolve.nodes[] | select(.id|match(".*coreutils#\\d+\\.\\d+\\.\\d+")) | .deps[] | select(.pkg|match("uu_")) | .name | sub("^uu_"; "")] | sort | join(" ")' + # Find 'coreutils' id with regex + # 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>#coreutils@0.0.26" + cargo metadata "$@" --format-version 1 | jq -r '[.resolve.nodes[] | select(.id|match(".*coreutils[ |@]\\d+\\.\\d+\\.\\d+")) | .deps[] | select(.pkg|match("uu_")) | .name | sub("^uu_"; "")] | sort | join(" ")' fi |