]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
configure: Fix config version checks for x.y versioning (without .z)
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 11 Dec 2024 08:42:27 +0000 (10:42 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 11 Dec 2024 12:35:19 +0000 (14:35 +0200)
configure.ac

index c7d26170acae00f8435051ccae8bb8e8ece29741..60f98647d566cae34659355f189b0c09260ef049 100644 (file)
@@ -257,8 +257,12 @@ AM_ICONV
 # SIZE_MAX is missing without this
 CXXFLAGS="$CXXFLAGS -D__STDC_LIMIT_MACROS"
 
-# Use the first x.y.z numbers of the version.
-DOVECOT_CONFIG_VERSION=$(echo "$PACKAGE_VERSION" | $SED 's/^\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\).*$/\1/')
+# Use the first x.y.z numbers of the version. Also allow x.y numbering.
+AS_IF([echo "$PACKAGE_VERSION" | grep '^[[0-9]]*\.[[0-9]]*\.[[0-9]]'], [
+  DOVECOT_CONFIG_VERSION=$(echo "$PACKAGE_VERSION" | $SED 's/^\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\).*$/\1/')
+], [
+  DOVECOT_CONFIG_VERSION=$(echo "$PACKAGE_VERSION" | $SED 's/^\([[0-9]]*\.[[0-9]]*\).*$/\1/')
+])
 if test "$is_pro_build" = "yes"; then
   SET_PRO_DEFINES
   AC_SUBST(DOVECOT_ASSET_URL, "doc.dovecotpro.com")