Skip to content

Commit

Permalink
check-abi: Minor UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Jan 9, 2024
1 parent ad5f589 commit b37fdb2
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tools/check-abi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ default_base_version="$(git describe --match "v*.*.*" --abbrev=0)"
default_new_version="HEAD"

display_help_and_exit() {
echo "Usage: $0 <base_ver> <new_ver>"
echo "Usage: $0 [<base_ver> [<new_ver>]]"
echo ""
echo "Description: This script uses the ABI Compliance Checker tool to determine if the ABI"
echo " of a new version of libsecp256k1 has changed in a backward-incompatible way."
echo ""
echo "Options:"
echo " base_ver Specify the base version (default: $default_base_version)"
echo " new_ver Specify the new version (default: $default_new_version)"
echo " base_ver Specify the base version as a git commit-ish"
echo " (default: most recent reachable tag matching \"v.*.*\", currently \"$default_base_version\")"
echo " new_ver Specify the new version as a git commit-ish"
echo " (default: $default_new_version)"
echo " -h, --help Display this help message"
exit 0
}
Expand All @@ -23,9 +25,11 @@ if [ "$#" -eq 0 ]; then
new_version="$default_new_version"
elif [ "$#" -eq 1 ] && { [ "$1" = "-h" ] || [ "$1" = "--help" ]; }; then
display_help_and_exit
elif [ "$#" -eq 2 ]; then
elif [ "$#" -eq 1 ] || [ "$#" -eq 2 ]; then
base_version="$1"
new_version="$2"
if [ "$#" -eq 2 ]; then
new_version="$2"
fi
else
echo "Invalid usage. See help:"
echo ""
Expand All @@ -52,10 +56,10 @@ checkout_and_build() {
echo "Comparing $base_version (base version) to $new_version (new version)"
echo

base_source_dir=$(mktemp -d)
base_source_dir="$(mktemp -d)"
checkout_and_build "$base_source_dir" "$base_version"

new_source_dir=$(mktemp -d)
new_source_dir="$(mktemp -d)"
checkout_and_build "$new_source_dir" "$new_version"

abi-compliance-checker -lib libsecp256k1 -old "${base_source_dir}/build/ABI.dump" -new "${new_source_dir}/build/ABI.dump"
Expand Down

0 comments on commit b37fdb2

Please sign in to comment.