From f8ec85ddae20736d33fb6542e20973ce75c1ec80 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Fri, 2 Jul 2021 21:22:43 -0400 Subject: [PATCH 1/6] bug --- tools/script_manager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 8f26f75..a70ec9c 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -87,7 +87,7 @@ local MIN_BUTTONS_PER_PAGE = 5 local MAX_BUTTONS_PER_PAGE = 20 local DEFAULT_BUTTONS_PER_PAGE = 10 -local DEFAULT_LOG_LEVEL = log.error +local DEFAULT_LOG_LEVEL = log.debug local LUA_DIR = dt.configuration.config_dir .. PS .. "lua" local LUA_SCRIPT_REPO = "https://github.com/darktable-org/lua-scripts.git" From 93cc0adb398c0950c805f9db9e5878e61e4044c8 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Fri, 2 Jul 2021 21:25:36 -0400 Subject: [PATCH 2/6] bug --- tools/script_manager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index a70ec9c..9c7e388 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -880,7 +880,7 @@ if sm.executables.git and clean and checkout_repo_branch(repo, "master") end end - elseif #branches and LUA_API_VER > branches[#branches] then + elseif branches ~= nil and LUA_API_VER > branches[#branches] then log.msg(log.info, "no newer branches, staying on master") -- stay on master else From 440dfcadfd4f7b990228f2f6df6a177a7b0bfb41 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Fri, 2 Jul 2021 21:26:45 -0400 Subject: [PATCH 3/6] bug --- tools/script_manager.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 9c7e388..1cee765 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -880,9 +880,11 @@ if sm.executables.git and clean and checkout_repo_branch(repo, "master") end end - elseif branches ~= nil and LUA_API_VER > branches[#branches] then - log.msg(log.info, "no newer branches, staying on master") - -- stay on master + elseif branches then + if LUA_API_VER > branches[#branches] then + log.msg(log.info, "no newer branches, staying on master") + -- stay on master + end else -- checkout the appropriate branch for API version if it exists log.msg(log.info, "checking out the appropriate API branch") From e32c0c70a838e24cd8f6b942bb86b6fed269cec8 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Fri, 2 Jul 2021 21:28:26 -0400 Subject: [PATCH 4/6] bug --- tools/script_manager.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 1cee765..1df213f 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -881,6 +881,7 @@ if sm.executables.git and clean and end end elseif branches then + dt.print_log("branches has " .. #branches .. " branches") if LUA_API_VER > branches[#branches] then log.msg(log.info, "no newer branches, staying on master") -- stay on master From 887bc03f3240168c04199d575b973f2e69d66b6b Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Fri, 2 Jul 2021 21:29:36 -0400 Subject: [PATCH 5/6] bug --- tools/script_manager.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 1df213f..acba4a6 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -880,12 +880,9 @@ if sm.executables.git and clean and checkout_repo_branch(repo, "master") end end - elseif branches then - dt.print_log("branches has " .. #branches .. " branches") - if LUA_API_VER > branches[#branches] then - log.msg(log.info, "no newer branches, staying on master") - -- stay on master - end + elseif #branches >0 and LUA_API_VER > branches[#branches] then + log.msg(log.info, "no newer branches, staying on master") + -- stay on master else -- checkout the appropriate branch for API version if it exists log.msg(log.info, "checking out the appropriate API branch") From 422fdbe2cf9a6c9b04c2294958a29969f0f2a9e4 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Fri, 2 Jul 2021 21:33:50 -0400 Subject: [PATCH 6/6] [script_manager] make sure we have branches before comparing --- tools/script_manager.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index acba4a6..cf76414 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -87,7 +87,7 @@ local MIN_BUTTONS_PER_PAGE = 5 local MAX_BUTTONS_PER_PAGE = 20 local DEFAULT_BUTTONS_PER_PAGE = 10 -local DEFAULT_LOG_LEVEL = log.debug +local DEFAULT_LOG_LEVEL = log.error local LUA_DIR = dt.configuration.config_dir .. PS .. "lua" local LUA_SCRIPT_REPO = "https://github.com/darktable-org/lua-scripts.git" @@ -210,7 +210,7 @@ end local function get_current_repo_branch(repo_data) local branch = nil branch = string.match(repo_data, "On branch (.-)\n") - log.msg(log.info, "\ncurrent rep0 branch is " .. branch) + log.msg(log.info, "\ncurrent repo branch is " .. branch) return branch end @@ -880,7 +880,7 @@ if sm.executables.git and clean and checkout_repo_branch(repo, "master") end end - elseif #branches >0 and LUA_API_VER > branches[#branches] then + elseif #branches > 0 and LUA_API_VER > branches[#branches] then log.msg(log.info, "no newer branches, staying on master") -- stay on master else