Skip to content

Commit 3b96ff1

Browse files
lcheylusBenWiederhake
authored andcommitted
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>#[email protected]" Fix #6242 Signed-off-by: Laurent Cheylus <[email protected]>
1 parent 99d234a commit 3b96ff1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

util/show-utils.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,8 @@ cd "${project_main_dir}" &&
3333
echo "WARN: missing \`jq\` (install with \`sudo apt install jq\`); falling back to default (only fully cross-platform) utility list" 1>&2
3434
echo "$default_utils"
3535
else
36-
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(" ")'
36+
# Find 'coreutils' id with regex
37+
# with cargo v1.76.0, id = "coreutils 0.0.26 (path+file://<coreutils local directory>)"
38+
# with cargo v1.77.0, id = "path+file://<coreutils local directory>#[email protected]"
39+
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(" ")'
3740
fi

0 commit comments

Comments
 (0)