From 3b96ff1d10a4d74e7018c6a84474de75d168136c Mon Sep 17 00:00:00 2001 From: Laurent Cheylus Date: Wed, 1 May 2024 10:40:50 +0200 Subject: [PATCH] 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://)" - with cargo v1.77, id = "path+file://#coreutils@0.0.26" Fix uutils/coreutils#6242 Signed-off-by: Laurent Cheylus --- util/show-utils.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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://)" + # with cargo v1.77.0, id = "path+file://#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