From 8efab7406670f88a662f386f3a680f8ec2b18fca Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Wed, 14 Apr 2021 13:06:15 +0200 Subject: [PATCH] scripts/api-version-bump.sh: require explicit version parameter To avoid accidentally changing the API version, the script now aborts if no new version other than the current API version has been specified. --- scripts/api-version-bump.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/api-version-bump.sh b/scripts/api-version-bump.sh index 0de5b3ba..5e237837 100755 --- a/scripts/api-version-bump.sh +++ b/scripts/api-version-bump.sh @@ -6,7 +6,12 @@ if ! test -f configure.ac; then fi declare $(sed -ne '/^LIBCOAP_API_VERSION=[0-9]\+/{p; q}' configure.ac) -NEW_VERSION=${1:-$((LIBCOAP_API_VERSION + 1))} +NEW_VERSION=${1:-$LIBCOAP_API_VERSION} + +if test "x$NEW_VERSION" = "x$LIBCOAP_API_VERSION"; then + >&2 echo "no version change requested, exiting (current version is $LIBCOAP_API_VERSION)" + exit 1 +fi echo $(basename $0): increase version $LIBCOAP_API_VERSION to $NEW_VERSION