From 33f62569481e04673285b80c4ecee4b738b76c6e Mon Sep 17 00:00:00 2001 From: parazyd Date: Mon, 16 May 2022 18:46:24 +0200 Subject: [PATCH] Rework compile_all_bins --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- contrib/cargo-outdated | 2 +- script/compile_all_bins.sh | 19 +++++++------------ 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef71b3ff0..d32f6c524 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3383,9 +3383,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "0.3.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" +checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" dependencies = [ "base64", ] diff --git a/Cargo.toml b/Cargo.toml index 14eeff944..25fbb10e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ ntp = {version = "0.5.0", optional = true} # TLS cert utilities ed25519-compact = {version = "1.0.11", features = ["pem"], optional = true} rcgen = {version = "0.9.2", features = ["pem"], optional = true} -rustls-pemfile = {version = "0.3.0", optional = true} +rustls-pemfile = {version = "1.0.0", optional = true} # Encoding hex = {version = "0.4.3", optional = true} diff --git a/contrib/cargo-outdated b/contrib/cargo-outdated index 251bcaf08..189e22a91 100755 --- a/contrib/cargo-outdated +++ b/contrib/cargo-outdated @@ -165,7 +165,7 @@ def main(): ]) if args.update and ret: - print(f"Update {dep} from {ret[0]} to {ret[1]}? (y/N)") + print(f"Update {dep} from {ret[0]} to {ret[1]}? (y/N): ", end="") choice = input() if choice and (choice == "y" or choice == "Y"): if "dependencies" in ps and dep in ps["dependencies"]: diff --git a/script/compile_all_bins.sh b/script/compile_all_bins.sh index ab87c2e5f..65fcc0c9c 100755 --- a/script/compile_all_bins.sh +++ b/script/compile_all_bins.sh @@ -1,17 +1,12 @@ #!/bin/sh set -e -# foo|bar|baz -skip_bins='cashierd' +toplevel="$(git rev-parse --show-toplevel)" +dirs="$(grep '"bin/' "$toplevel/Cargo.toml" | grep -v '#' | tr -d '", \t')" -find_packages() { - find bin -type f -name Cargo.toml | while read line; do - if echo "$line" | grep -Eq "$skip_bins"; then - continue - fi +bins="" +for i in $dirs; do + bins="$bins $(grep '^name = ' "$i/Cargo.toml" | cut -d' ' -f3 | tr -d '"')" +done - echo "$(basename "$(dirname "$line")")" - done -} - -make BINS="$(find_packages | xargs)" +make BINS="$bins"