0.3.1.10 and 0.2.9.15 changelogs got left out too
[tor.git] / scripts / maint / updateRustDependencies.sh
bloba5a92579d3e8d4e9b16a15fde59b8070d8bcc3a5
1 #!/usr/bin/env bash
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
11 # versions.
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
16 # your crate).
18 # Next, run this script. Then, go into src/ext/rust and commit the
19 # changes to the tor-rust-dependencies repo.
21 set -e
23 HERE=`dirname $(realpath $0)`
24 TOPLEVEL=`dirname $(dirname $HERE)`
25 TOML="$TOPLEVEL/src/rust/Cargo.toml"
26 VENDORED="$TOPLEVEL/src/ext/rust/crates"
27 CARGO=`which cargo`
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