Skip to content

Commit

Permalink
show-utils.sh: fix jq query to get coreutils deps
Browse files Browse the repository at this point in the history
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 #6242

Signed-off-by: Laurent Cheylus <[email protected]>
  • Loading branch information
lcheylus authored and BenWiederhake committed May 4, 2024
1 parent 99d234a commit 3b96ff1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/show-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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>#[email protected]"
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

0 comments on commit 3b96ff1

Please sign in to comment.