3 # Copyright (c) 2018 The Tor Project, Inc.
4 # Copyright (c) 2018 isis agora lovecruft
5 # See LICENSE for license information
7 # updateRustDependencies.sh
8 # -------------------------
9 # Update our vendored Rust dependencies, either adding/removing
10 # dependencies and/or upgrading current dependencies to newer
13 # To use this script, first add your dependencies, exactly specifying
14 # their versions, into the appropriate *crate-level* Cargo.toml in
15 # src/rust/ (i.e. *not* /src/rust/Cargo.toml, but instead the one for
18 # Next, run this script. Then, go into src/ext/rust and commit the
19 # changes to the tor-rust-dependencies repo.
23 HERE
=`dirname $(realpath $0)`
24 TOPLEVEL
=`dirname $(dirname $HERE)`
25 TOML
="$TOPLEVEL/src/rust/Cargo.toml"
26 VENDORED
="$TOPLEVEL/src/ext/rust/crates"
29 if ! test -f "$TOML" ; then
30 printf "Error: Couldn't find workspace Cargo.toml in expected location: %s\n" "$TOML"
33 if ! test -d "$VENDORED" ; then
34 printf "Error: Couldn't find directory for Rust dependencies! Expected location: %s\n" "$VENDORED"
37 if test -z "$CARGO" ; then
38 printf "Error: cargo must be installed and in your \$PATH\n"
41 if test -z `cargo --list | grep vendor` ; then
42 printf "Error: cargo-vendor not installed\n"
45 $CARGO vendor
-v --locked --explicit-version --no-delete --sync $TOML $VENDORED