From a657695fa64306317d6f3ce43bc935ac4acd16ec Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Mon, 4 Oct 2010 14:26:18 +0200 Subject: [PATCH] improve syntax mismatch message: show all supported versions Signed-off-by: Gordon Hecker --- local/e2tool.lua | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/local/e2tool.lua b/local/e2tool.lua index c6528a8..e33c95f 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -449,14 +449,6 @@ function collect_project_info(info, skip_load_config) info.config_syntax_file = ".e2/syntax" rc, re = check_config_syntax_compat(info) if not rc then - local s = [[ -Your configuration syntax is incompatible with this tool version. -Please read the configuration Changelog, update your project configuration -and finally insert the new configuration syntax version into %s - -The newest configuration syntax supported by the tools is %s. -]] - e2lib.logf(2, s, info.config_syntax_file, info.config_syntax_compat[1]) e2lib.finish(1) end @@ -2462,19 +2454,9 @@ function lcd(info, dir) return true end ---- check for configuration syntax compatibility --- @param info --- @return bool --- @return an error object on failure -function display_config_syntax_compat(info) - local e = new_error("displaying configuration syntax compatibilitly failed") - for _,m in ipairs(info.config_syntax_compat) do - print(m) - end - return true -end - ---- check for configuration syntax compatibility +--- check for configuration syntax compatibility and log informational +-- message including list of supported syntaxes if incompatibility is +-- detected. -- @param info -- @return bool -- @return an error object on failure @@ -2490,6 +2472,17 @@ function check_config_syntax_compat(info) return true, nil end end + local s = [[ +Your configuration syntax is incompatible with this tool version. +Please read the configuration Changelog, update your project configuration +and finally insert the new configuration syntax version into %s + +Configuration syntax versions supported by this version of the tools are: +]] + e2lib.logf(2, s, info.config_syntax_file) + for _,m in ipairs(info.config_syntax_compat) do + e2lib.logf(2, " %s", m) + end return false, e:append("configuration syntax mismatch") end -- 2.39.5