Update Cargo.toml link in vendor script

This commit is contained in:
Steven Roose 2019-12-11 15:54:30 +00:00
parent ff6e944875
commit 65fe733ad0
No known key found for this signature in database
GPG Key ID: 2F2A88D7F8D68E87
1 changed files with 6 additions and 1 deletions

View File

@ -55,7 +55,7 @@ find "$DIR" -not -path '*/\.*' -type f -print0 | xargs -0 sed -i "/^#include/! s
find "$DIR" -not -path '*/\.*' -type f -print0 | xargs -0 sed -i 's/^const int CURVE_B/static const int CURVE_B/g' find "$DIR" -not -path '*/\.*' -type f -print0 | xargs -0 sed -i 's/^const int CURVE_B/static const int CURVE_B/g'
while true; do while true; do
read -r -p "Update Rust extern references as well? [yn]: " yn read -r -p "Update Rust extern references and Cargo.toml as well? [yn]: " yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) exit;; [Nn]* ) exit;;
@ -64,5 +64,10 @@ while true; do
done done
cd "$ORIGDIR" cd "$ORIGDIR"
# Update the `links = ` in the manifest file.
sed -i -r "s/^links = \".*\"$/links = \"rustsecp256k1_v${VERSIONCODE}\"/" Cargo.toml
# Update the extern references in the Rust FFI source files.
find "./src/" -name "*.rs" -type f -print0 | xargs -0 sed -i -r "s/rustsecp256k1_v[0-9]+_[0-9]+_[0-9]+_(.*)([\"\(])/rustsecp256k1_v${VERSIONCODE}_\1\2/g" find "./src/" -name "*.rs" -type f -print0 | xargs -0 sed -i -r "s/rustsecp256k1_v[0-9]+_[0-9]+_[0-9]+_(.*)([\"\(])/rustsecp256k1_v${VERSIONCODE}_\1\2/g"