test -f Cargo.lock.orig || cp Cargo.lock Cargo.lock.orig
test -f src/bootstrap/Cargo.lock.orig || cp src/bootstrap/Cargo.lock src/bootstrap/Cargo.lock.orig
test -f src/tools/rust-analyzer/Cargo.lock.orig || cp src/tools/rust-analyzer/Cargo.lock src/tools/rust-analyzer/Cargo.lock.orig
-test -f src/tools/cargo/Cargo.lock.orig || cp src/tools/cargo/Cargo.lock src/tools/cargo/Cargo.lock.orig
rm -f Cargo.lock src/bootstrap/Cargo.lock src/tools/rust-analyzer/Cargo.lock src/tools/cargo/Cargo.lock
find vendor -name .cargo-checksum.json -execdir "$scriptdir/debian/prune-checksums" "{}" +
# re-generate src/tools/rust-analyzer/Cargo.lock after patching
( cd src/tools/rust-analyzer && cargo update --offline )
-# re-generate src/tools/cargo/Cargo.lock after patching
-( cd src/tools/cargo && cargo update --offline )
-
needed_crates() {
cat Cargo.lock \
src/bootstrap/Cargo.lock \
src/tools/rust-analyzer/Cargo.lock \
- src/tools/cargo/Cargo.lock \
| sed -z -e 's/\nname = /name = /g' -e 's/\nversion = /version = /g' \
| sed -ne 's/\[\[package\]\]name = "\(.*\)"version = "\(.*\)"/\1 \2/gp'
}