]> source.dussan.org Git - rspamd.git/commitdiff
[Rework] Breaking: return back to semver
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 13 Sep 2023 10:47:28 +0000 (11:47 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 13 Sep 2023 10:47:57 +0000 (11:47 +0100)
CMakeLists.txt
config.h.in
src/lua/lua_common.c

index d3db35b20ff16df8b90ee2b92d56c704558bd1c9..68a9d1f890caab0a7cf8ac334b49071287af9771 100644 (file)
@@ -9,17 +9,19 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.12 FATAL_ERROR)
 
 SET(RSPAMD_VERSION_MAJOR 3)
 SET(RSPAMD_VERSION_MINOR 7)
+SET(RSPAMD_VERSION_PATCH 0)
 
 # Keep two digits all the time
 SET(RSPAMD_VERSION_MAJOR_NUM ${RSPAMD_VERSION_MAJOR}0)
 SET(RSPAMD_VERSION_MINOR_NUM ${RSPAMD_VERSION_MINOR}0)
+SET(RSPAMD_VERSION_PATCH_NUM ${RSPAMD_VERSION_PATCH}0)
 
 IF (GIT_ID)
     SET(GIT_VERSION 1)
     SET(RSPAMD_ID "${GIT_ID}")
 ENDIF ()
 
-SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}")
+SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}.${RSPAMD_VERSION_PATCH}")
 
 PROJECT(rspamd VERSION "${RSPAMD_VERSION}" LANGUAGES C CXX ASM)
 
index 44dc3cdf34b16dc3b692c811c1a90c16edd0a24f..5b5461f4c4f40b51358523f2d68fa639ad055adf 100644 (file)
 
 #define RSPAMD_VERSION_MAJOR "${RSPAMD_VERSION_MAJOR}"
 #define RSPAMD_VERSION_MINOR "${RSPAMD_VERSION_MINOR}"
+#define RSPAMD_VERSION_PATCH "${RSPAMD_VERSION_PATCH}"
 
 #define RSPAMD_VERSION_MAJOR_NUM ${RSPAMD_VERSION_MAJOR_NUM}
 #define RSPAMD_VERSION_MINOR_NUM ${RSPAMD_VERSION_MINOR_NUM}
+#define RSPAMD_VERSION_PATCH_NUM ${RSPAMD_VERSION_PATCH_NUM}
 
 #define RSPAMD_VERSION_BRANCH "${RSPAMD_VERSION_MAJOR}"
 
index bafe8ea93f752847b3f605e7d4eec8f4f7b8d747..9bf9514f6ed85433c1ea7b4dc5565f2a2e818d4a 100644 (file)
@@ -475,15 +475,20 @@ rspamd_lua_rspamd_version_numeric(lua_State *L)
                type = lua_tostring(L, 1);
                if (g_ascii_strcasecmp(type, "short") == 0) {
                        version_num = RSPAMD_VERSION_MAJOR_NUM * 1000 +
-                                                 RSPAMD_VERSION_MINOR_NUM * 100;
+                                                 RSPAMD_VERSION_MINOR_NUM * 100 +
+                                                 RSPAMD_VERSION_PATCH_NUM * 10;
                }
                else if (g_ascii_strcasecmp(type, "main") == 0) {
                        version_num = RSPAMD_VERSION_MAJOR_NUM * 1000 +
-                                                 RSPAMD_VERSION_MINOR_NUM * 100;
+                                                 RSPAMD_VERSION_MINOR_NUM * 100 +
+                                                 RSPAMD_VERSION_PATCH_NUM * 10;
                }
                else if (g_ascii_strcasecmp(type, "major") == 0) {
                        version_num = RSPAMD_VERSION_MAJOR_NUM;
                }
+               else if (g_ascii_strcasecmp(type, "patch") == 0) {
+                       version_num = RSPAMD_VERSION_PATCH_NUM;
+               }
                else if (g_ascii_strcasecmp(type, "minor") == 0) {
                        version_num = RSPAMD_VERSION_MINOR_NUM;
                }
@@ -511,7 +516,7 @@ rspamd_lua_rspamd_version(lua_State *L)
                                "." RSPAMD_VERSION_MINOR;
                }
                else if (g_ascii_strcasecmp(type, "main") == 0) {
-                       result = RSPAMD_VERSION_MAJOR "." RSPAMD_VERSION_MINOR;
+                       result = RSPAMD_VERSION_MAJOR "." RSPAMD_VERSION_MINOR "." RSPAMD_VERSION_PATCH;
                }
                else if (g_ascii_strcasecmp(type, "major") == 0) {
                        result = RSPAMD_VERSION_MAJOR;
@@ -519,6 +524,9 @@ rspamd_lua_rspamd_version(lua_State *L)
                else if (g_ascii_strcasecmp(type, "minor") == 0) {
                        result = RSPAMD_VERSION_MINOR;
                }
+               else if (g_ascii_strcasecmp(type, "patch") == 0) {
+                       result = RSPAMD_VERSION_PATCH;
+               }
                else if (g_ascii_strcasecmp(type, "id") == 0) {
                        result = RID;
                }