From 52a7957cabc961d25b2eb765c34ca4e06844e197 Mon Sep 17 00:00:00 2001 From: "Alexandru N. Onea" Date: Tue, 9 Apr 2019 21:51:27 +0300 Subject: Add check action to version-bump.sh; Activate checks --- scripts/version-bump.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'scripts') diff --git a/scripts/version-bump.sh b/scripts/version-bump.sh index 287580b..05fbf37 100755 --- a/scripts/version-bump.sh +++ b/scripts/version-bump.sh @@ -6,6 +6,7 @@ # # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= VERSION_FILE="include/tinyalsa/version.h" +CHANGELOG_FILE="debian/changelog" # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # @@ -154,6 +155,21 @@ bump_version() return 0 } +check_version() +{ + get_version + + LOG_VERSION=$(grep -m 1 "^tinyalsa (" ${CHANGELOG_FILE}| sed "s/[^0-9.]*//g") + REF_VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" + + if [ "${LOG_VERSION}" != "${REF_VERSION}" ]; then + die "Changelog version (${LOG_VERSION}) does not match package version (${REF_VERSION})." + fi + + printf "Changelog version (${LOG_VERSION}) OK!${LF}" + return 0 +} + # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Command Line parsing @@ -175,6 +191,10 @@ parse_command() bump_version "$2" exit $? ;; + check) + check_version + exit $? + ;; *) die "Unsupported action \"$1\"." ;; -- cgit v1.2.3