From eb75c68f30b346b352e69eae90c363c8ef113175 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 23 Feb 2018 13:20:14 +0000 Subject: [PATCH] [Refactor] Rename all lua libraries in the common way --- lualib/global_functions.lua | 4 ++-- lualib/{auth_results.lua => lua_auth_results.lua} | 0 lualib/{rspamd_config_transform.lua => lua_cfg_transform.lua} | 0 lualib/{dkim_sign_tools.lua => lua_dkim_tools.lua} | 0 lualib/{maps.lua => lua_maps.lua} | 0 lualib/{meta_functions.lua => lua_meta.lua} | 0 lualib/{stat_tools.lua => lua_stat.lua} | 0 lualib/rspamadm/configwizard.lua | 2 +- lualib/rspamadm/stat_convert.lua | 2 +- src/libserver/cfg_rcl.c | 2 +- src/plugins/lua/arc.lua | 4 ++-- src/plugins/lua/dkim_signing.lua | 2 +- src/plugins/lua/fann_redis.lua | 2 +- src/plugins/lua/milter_headers.lua | 2 +- src/plugins/lua/ratelimit.lua | 2 +- src/plugins/lua/reputation.lua | 2 +- src/plugins/lua/settings.lua | 2 +- 17 files changed, 13 insertions(+), 13 deletions(-) rename lualib/{auth_results.lua => lua_auth_results.lua} (100%) rename lualib/{rspamd_config_transform.lua => lua_cfg_transform.lua} (100%) rename lualib/{dkim_sign_tools.lua => lua_dkim_tools.lua} (100%) rename lualib/{maps.lua => lua_maps.lua} (100%) rename lualib/{meta_functions.lua => lua_meta.lua} (100%) rename lualib/{stat_tools.lua => lua_stat.lua} (100%) diff --git a/lualib/global_functions.lua b/lualib/global_functions.lua index 956db8bed..05c967534 100644 --- a/lualib/global_functions.lua +++ b/lualib/global_functions.lua @@ -17,8 +17,8 @@ limitations under the License. local logger = require "rspamd_logger" local lua_util = require "lua_util" local lua_redis = require "lua_redis" -local meta_functions = require "meta_functions" -local maps = require "maps" +local meta_functions = require "lua_meta" +local maps = require "lua_maps" local exports = {} diff --git a/lualib/auth_results.lua b/lualib/lua_auth_results.lua similarity index 100% rename from lualib/auth_results.lua rename to lualib/lua_auth_results.lua diff --git a/lualib/rspamd_config_transform.lua b/lualib/lua_cfg_transform.lua similarity index 100% rename from lualib/rspamd_config_transform.lua rename to lualib/lua_cfg_transform.lua diff --git a/lualib/dkim_sign_tools.lua b/lualib/lua_dkim_tools.lua similarity index 100% rename from lualib/dkim_sign_tools.lua rename to lualib/lua_dkim_tools.lua diff --git a/lualib/maps.lua b/lualib/lua_maps.lua similarity index 100% rename from lualib/maps.lua rename to lualib/lua_maps.lua diff --git a/lualib/meta_functions.lua b/lualib/lua_meta.lua similarity index 100% rename from lualib/meta_functions.lua rename to lualib/lua_meta.lua diff --git a/lualib/stat_tools.lua b/lualib/lua_stat.lua similarity index 100% rename from lualib/stat_tools.lua rename to lualib/lua_stat.lua diff --git a/lualib/rspamadm/configwizard.lua b/lualib/rspamadm/configwizard.lua index a86bb78ec..fc9005ce0 100644 --- a/lualib/rspamadm/configwizard.lua +++ b/lualib/rspamadm/configwizard.lua @@ -19,7 +19,7 @@ local local_conf = rspamd_paths['CONFDIR'] local rspamd_util = require "rspamd_util" local rspamd_logger = require "rspamd_logger" local lua_util = require "lua_util" -local lua_stat_tools = require "stat_tools" +local lua_stat_tools = require "lua_stat" local lua_redis = require "lua_redis" local ucl = require "ucl" diff --git a/lualib/rspamadm/stat_convert.lua b/lualib/rspamadm/stat_convert.lua index f70581fa4..6ad3b0332 100644 --- a/lualib/rspamadm/stat_convert.lua +++ b/lualib/rspamadm/stat_convert.lua @@ -1,5 +1,5 @@ local lua_redis = require "lua_redis" -local stat_tools = require "stat_tools" +local stat_tools = require "lua_stat" local ucl = require "ucl" local logger = require "rspamd_logger" diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index 889bc7072..97148d22b 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -3549,7 +3549,7 @@ rspamd_rcl_maybe_apply_lua_transform (struct rspamd_config *cfg) gint err_idx, ret; GString *tb; gchar str[PATH_MAX]; - static const char *transform_script = "rspamd_config_transform"; + static const char *transform_script = "lua_cfg_transform"; g_assert (L != NULL); diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index c87946aff..29faa1258 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -16,12 +16,12 @@ limitations under the License. local rspamd_logger = require "rspamd_logger" local lua_util = require "lua_util" -local dkim_sign_tools = require "dkim_sign_tools" +local dkim_sign_tools = require "lua_dkim_tools" local rspamd_util = require "rspamd_util" local rspamd_rsa_privkey = require "rspamd_rsa_privkey" local rspamd_rsa = require "rspamd_rsa" local fun = require "fun" -local auth_results = require "auth_results" +local auth_results = require "lua_auth_results" local hash = require "rspamd_cryptobox_hash" if confighelp then diff --git a/src/plugins/lua/dkim_signing.lua b/src/plugins/lua/dkim_signing.lua index 75720df9d..de9a286ff 100644 --- a/src/plugins/lua/dkim_signing.lua +++ b/src/plugins/lua/dkim_signing.lua @@ -17,7 +17,7 @@ limitations under the License. local lutil = require "lua_util" local rspamd_logger = require "rspamd_logger" -local dkim_sign_tools = require "dkim_sign_tools" +local dkim_sign_tools = require "lua_dkim_tools" local rspamd_util = require "rspamd_util" if confighelp then diff --git a/src/plugins/lua/fann_redis.lua b/src/plugins/lua/fann_redis.lua index 3120d8b18..828060240 100644 --- a/src/plugins/lua/fann_redis.lua +++ b/src/plugins/lua/fann_redis.lua @@ -27,7 +27,7 @@ local rspamd_util = require "rspamd_util" local rspamd_redis = require "lua_redis" local lua_util = require "lua_util" local fun = require "fun" -local meta_functions = require "meta_functions" +local meta_functions = require "lua_meta" local use_torch = false local torch local nn diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua index a0cca43d3..176597b60 100644 --- a/src/plugins/lua/milter_headers.lua +++ b/src/plugins/lua/milter_headers.lua @@ -350,7 +350,7 @@ local function milter_headers(task) routines['authentication-results'] = function() if skip_wanted('authentication-results') then return end - local ar = require "auth_results" + local ar = require "lua_auth_results" if settings.routines['authentication-results'].remove then remove[settings.routines['authentication-results'].header] = diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index f77e2ae76..d18b79bfe 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -50,7 +50,7 @@ local rspamd_util = require "rspamd_util" local rspamd_lua_utils = require "lua_util" local lua_redis = require "lua_redis" local fun = require "fun" -local lua_maps = require "maps" +local lua_maps = require "lua_maps" local lua_util = require "lua_util" local user_keywords = {'user'} diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua index 0d870eee8..9c5f2aaad 100644 --- a/src/plugins/lua/reputation.lua +++ b/src/plugins/lua/reputation.lua @@ -26,7 +26,7 @@ local N = 'reputation' local rspamd_logger = require "rspamd_logger" local rspamd_util = require "rspamd_util" local lua_util = require "lua_util" -local lua_maps = require "maps" +local lua_maps = require "lua_maps" local hash = require 'rspamd_cryptobox_hash' local fun = require "fun" local redis_params = nil diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua index 1963f9d70..d35c91adf 100644 --- a/src/plugins/lua/settings.lua +++ b/src/plugins/lua/settings.lua @@ -23,7 +23,7 @@ end -- https://rspamd.com/doc/configuration/settings.html local rspamd_logger = require "rspamd_logger" -local rspamd_maps = require "maps" +local rspamd_maps = require "lua_maps" local redis_params local settings = {} -- 2.39.5