Skip to content

Commit 2ae7ca9

Browse files
committed
secp-sys: update README for new vendoring script
Also a couple minor tweaks to the vendoring script itself.
1 parent 4b02e9c commit 2ae7ca9

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

secp256k1-sys/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ This prefix ensures that no symbol collision can happen:
2020
To update the vendored sources, use the `vendor-libsecp.sh` script:
2121

2222
```
23-
$ ./vendor-libsecp.sh depend <version-code> <rev>
23+
$ ./vendor-libsecp.sh <rev>
2424
```
2525

26-
- Where `<version-code>` is the secp256k1-sys version number underscored: `0_1_2`.
27-
- Where `<rev>` is the git revision of libsecp256k1 to checkout.
26+
Where `<rev>` is the git revision of libsecp256k1 to checkout. If you do not
27+
specify a revision, the script will simply clone the repo and use whatever
28+
revision the default branch is pointing to.
2829

2930

3031
## Linking to external symbols
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# This file was automatically created by ./vendor-libsecp.sh
1+
# This file was automatically created by vendor-libsecp.sh
22
21ffe4b22a9683cf24ae0763359e401d1284cc7a

secp256k1-sys/vendor-libsecp.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
set -e
33

44
# Set default variables
5-
: "${SECP_VENDOR_GIT_ROOT:=$(git rev-parse --show-toplevel)}"
5+
if [ -z "$SECP_VENDOR_GIT_ROOT" ]; then
6+
SECP_VENDOR_GIT_ROOT="$(git rev-parse --show-toplevel)"
7+
else
8+
SECP_VENDOR_GIT_ROOT="$(realpath "$SECP_VENDOR_GIT_ROOT")"
9+
fi
610
SECP_SYS="$SECP_VENDOR_GIT_ROOT"/secp256k1-sys
711
DEFAULT_VERSION_CODE=$(grep version "$SECP_SYS/Cargo.toml" | sed 's/\./_/g' | sed 's/.*"\(.*\)".*/\1/')
812
DEFAULT_DEPEND_DIR="$SECP_SYS/depend"
@@ -83,7 +87,7 @@ rm -rf .git/ || true
8387
popd
8488

8589
# Record revision
86-
echo "# This file was automatically created by $0" > ./secp256k1-HEAD-revision.txt
90+
echo "# This file was automatically created by $(basename "$0")" > ./secp256k1-HEAD-revision.txt
8791
echo "$SOURCE_REV" >> ./secp256k1-HEAD-revision.txt
8892

8993
# Patch source files

0 commit comments

Comments
 (0)