diff --git a/contrib/source-control-tools/automated-commits.sh b/contrib/source-control-tools/automated-commits.sh --- a/contrib/source-control-tools/automated-commits.sh +++ b/contrib/source-control-tools/automated-commits.sh @@ -95,15 +95,22 @@ version_less() { ! version_greater_equal "$1" "$2" } +get_current_version() { + # Get the current version of the software + "${DEVTOOLS_DIR}"/build_cmake.sh --no-build + pushd "$BUILD_DIR" + CURRENT_VERSION="$(ninja print-version | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$')" + popd + + echo "${CURRENT_VERSION}" +} # Common script to update the AUR packages. # Usage: update-aur-version update-aur-version() { PACKAGE="$1" - # Get the current version of the software - "${DEVTOOLS_DIR}"/build_cmake.sh --no-build - CURRENT_VERSION="$(ninja print-version | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$')" + CURRENT_VERSION="$(get_current_version)" # Get the current version of the AUR package PKGBUILD="${TOPLEVEL}"/contrib/aur/${PACKAGE}/PKGBUILD @@ -135,8 +142,7 @@ RELEASE_NOTES_VERSION=$(sed -n "1s/^Bitcoin ABC version \([0-9]\+\.[0-9]\+\.[0-9]\+\).\+$/\1/p" "${RELEASE_NOTES_FILE}") RELEASE_NOTES_ARCHIVE="${TOPLEVEL}/doc/release-notes/release-notes-${RELEASE_NOTES_VERSION}.md" - "${DEVTOOLS_DIR}"/build_cmake.sh --no-build - CURRENT_VERSION="$(ninja print-version | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$')" + CURRENT_VERSION="$(get_current_version)" # Compare the versions. We only want to archive the release notes if the # current version is greater the our release notes version.