From 2fa22afbb8e80683afa2ae8b5f35dcd8e8c1299e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Wed, 11 Oct 2023 17:04:12 +0200 Subject: [PATCH 1/2] CI: Fix version parsing and calculating for 2.0 The previous logic failed on 2.0 to make the new version number 1.99.99. This is fixed now even though the code is not perfect or good at all but should work well enough for its purposes. --- scripts/ci_mingw64_geany.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/ci_mingw64_geany.sh b/scripts/ci_mingw64_geany.sh index 15be03e543..5a57693bcf 100644 --- a/scripts/ci_mingw64_geany.sh +++ b/scripts/ci_mingw64_geany.sh @@ -145,11 +145,17 @@ patch_version_information() { MAJOR="${BASH_REMATCH[1]}" MINOR="${BASH_REMATCH[2]}" PATCH="${BASH_REMATCH[4]}" - if [ -z "${PATCH}" ] || [ "${PATCH}" = "0" ]; then - MINOR="$((MINOR-1))" - PATCH="90" + if [[ "${MINOR}" = "0" && (-z "${PATCH}" || "${PATCH}" = "0") ]]; then + MAJOR="$((MAJOR-1))" + MINOR="99" + PATCH="99" else - PATCH="$((PATCH-1))" + if [[ -z "${PATCH}" || "${PATCH}" = "0" ]]; then + MINOR="$((MINOR-1))" + PATCH="99" + else + PATCH="$((PATCH-1))" + fi fi else echo "Could not extract or parse version tag" >&2 From 15ef1d536971a3c3be9eb0d6b4cd2363ab21fb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Wed, 11 Oct 2023 23:08:37 +0200 Subject: [PATCH 2/2] Use b4n's simpler version --- scripts/ci_mingw64_geany.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/ci_mingw64_geany.sh b/scripts/ci_mingw64_geany.sh index 5a57693bcf..cb33757cc1 100644 --- a/scripts/ci_mingw64_geany.sh +++ b/scripts/ci_mingw64_geany.sh @@ -145,17 +145,16 @@ patch_version_information() { MAJOR="${BASH_REMATCH[1]}" MINOR="${BASH_REMATCH[2]}" PATCH="${BASH_REMATCH[4]}" - if [[ "${MINOR}" = "0" && (-z "${PATCH}" || "${PATCH}" = "0") ]]; then - MAJOR="$((MAJOR-1))" - MINOR="99" - PATCH="99" - else - if [[ -z "${PATCH}" || "${PATCH}" = "0" ]]; then - MINOR="$((MINOR-1))" - PATCH="99" + if [ -z "${PATCH}" ] || [ "${PATCH}" = "0" ]; then + if [ "${MINOR}" = "0" ]; then + MAJOR="$((MAJOR-1))" + MINOR="99" else - PATCH="$((PATCH-1))" + MINOR="$((MINOR-1))" fi + PATCH="99" + else + PATCH="$((PATCH-1))" fi else echo "Could not extract or parse version tag" >&2