From e50a3a44717d03e4f69b83960a0337bfaaa86af9 Mon Sep 17 00:00:00 2001 From: Laurent Cheylus Date: Wed, 19 Jun 2024 17:35:45 +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, - if local path == '/coreutils/', id = "path+file:///coreutils#0.0.26" - if local path != '/coreutils/', id = "path+file://#coreutils@0.0.26" Fix uutils/coreutils#6479 Signed-off-by: Laurent Cheylus --- util/show-utils.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/show-utils.sh b/util/show-utils.sh index 3de0a6df4..0a41698d9 100755 --- a/util/show-utils.sh +++ b/util/show-utils.sh @@ -35,6 +35,8 @@ cd "${project_main_dir}" && else # 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(" ")' + # with cargo >= v1.77.0 + # - if local path != '<...>/coreutils' id = "path+file://#coreutils@0.0.26" + # - if local path == '<...>/coreutils' 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