From 85af23613e434403116da8c7e5e1283f777c43d8 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Fri, 10 Feb 2023 21:47:48 -0700 Subject: [PATCH] ci: suppress dep trees by default in `ci/do-audit.sh` (#30255) get them back by passing `--display-dependency-trees` --- ci/do-audit.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ci/do-audit.sh b/ci/do-audit.sh index b24f1abbae..d7c16187d7 100755 --- a/ci/do-audit.sh +++ b/ci/do-audit.sh @@ -7,6 +7,16 @@ src_root="$(readlink -f "${here}/..")" cd "${src_root}" +# `cargo-audit` doesn't give us a way to do this nicely, so hammer it is... +dep_tree_filter="grep -Ev '│|└|├|─'" + +while [[ -n $1 ]]; do + if [[ $1 = "--display-dependency-trees" ]]; then + dep_tree_filter="cat" + shift + fi +done + cargo_audit_ignores=( # Potential segfault in the time crate # @@ -19,4 +29,4 @@ cargo_audit_ignores=( # https://github.com/solana-labs/solana/issues/29586 --ignore RUSTSEC-2023-0001 ) -scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" +scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter