From 88e4ac1a64fdb974763a24522490847d268dd516 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Tue, 18 Jun 2024 00:29:27 -0400 Subject: [PATCH 1/2] tools/script_manager - changed API check from hard (crash) to soft which allows script_manager to fix tthe problem by checking out the correct version of the scripts for the API version. --- tools/script_manager.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 955f483..40a6962 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -68,12 +68,15 @@ end -- api check -du.check_min_api_version("9.3.0", "script_manager") +-- du.check_min_api_version("9.3.0", "script_manager") -- - - - - - - - - - - - - - - - - - - - - - - - -- C O N S T A N T S -- - - - - - - - - - - - - - - - - - - - - - - - +-- script_manager required API version +local SM_API_VER_REQD = "9.3.0" + -- path separator local PS = dt.configuration.running_os == "windows" and "\\" or "/" @@ -1189,7 +1192,7 @@ end script_manager_running_script = "script_manager" -if check_for_updates then +if check_for_updates or SM_API_VER_REQD > dt.configuration.api_version_string then local repo_data = get_repo_status(LUA_DIR) local current_branch = get_current_repo_branch(LUA_DIR) local clean = is_repo_clean(repo_data) @@ -1246,14 +1249,15 @@ if check_for_updates then local match = false - for _, branch in ipairs(branches) do + for _x, branch in ipairs(branches) do log.msg(log.debug, "checking branch " .. branch .. " against API " .. LUA_API_VER) if LUA_API_VER == branch then match = true log.msg(log.info, "checking out repo branch " .. branch) checkout_repo_branch(repo, branch) - log.msg(log.screen, "you must restart darktable to use the correct version of the lua") + log.msg(log.screen, _("you must restart darktable to use the correct version of the lua scripts")) + return end end From c95f8a23b2e371c69727ca2dc9a08ffa8b6919aa Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Tue, 18 Jun 2024 00:30:34 -0400 Subject: [PATCH 2/2] lib/dtutils/log - fix screen print check --- lib/dtutils/log.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dtutils/log.lua b/lib/dtutils/log.lua index 6910c8e..28dce69 100644 --- a/lib/dtutils/log.lua +++ b/lib/dtutils/log.lua @@ -199,7 +199,7 @@ function dtutils_log.msg(level, ...) table.remove(args, 1) end local log_msg = level.label - if level.engine ~= dt_screen and call_level ~= 0 then + if level.engine ~= dt_print and call_level ~= 0 then log_msg = log_msg .. dtutils_log.caller(call_level, level.caller_info) .. " " elseif log_msg:len() > 2 then log_msg = log_msg .. " "