Kaynağa Gözat

Rework compile_all_bins

parazyd 4 yıl önce
ebeveyn
işleme
33f6256948
4 değiştirilmiş dosya ile 11 ekleme ve 16 silme
  1. 2 2
      Cargo.lock
  2. 1 1
      Cargo.toml
  3. 1 1
      contrib/cargo-outdated
  4. 7 12
      script/compile_all_bins.sh

+ 2 - 2
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",
 ]

+ 1 - 1
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}

+ 1 - 1
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"]:

+ 7 - 12
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"