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.
This commit is contained in:
Olaf Bergmann committed 2021-04-14 13:06:15 +02:00
1 parent d9ecb04a99
commit 8efab74066
1 file changed
+6 -1
+6 -1
View File
@@ -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