Merge pull request #6485 from lcheylus/show_utils

show-utils.sh: fix jq query to get coreutils deps
This commit is contained in:
Sylvestre Ledru 2024-06-21 15:25:08 +02:00 committed by GitHub
commit 32c5d23f91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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://<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(" ")'
# with cargo >= v1.77.0
# - if local path != '<...>/coreutils' id = "path+file://<coreutils local directory>#coreutils@0.0.26"
# - if local path == '<...>/coreutils' id = "path+file://<parent 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