From c2c049448c4357eeb8474f21e880fd7258d90d80 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Tue, 17 Jan 2023 17:09:16 -0500 Subject: Fixed up plugin manager plugin, moving to optimization. --- src/lpm.c | 1 + src/lpm.lua | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lpm.c b/src/lpm.c index 03c19f5..1d66e41 100644 --- a/src/lpm.c +++ b/src/lpm.c @@ -969,6 +969,7 @@ int lpm_flock(lua_State* L) { UnlockFile(file, 0, 0, 1, 0); CloseHandle(file); #else + flock(fd, LOCK_UN); close(fd); #endif if (err) diff --git a/src/lpm.lua b/src/lpm.lua index b100d43..a950e27 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1478,11 +1478,11 @@ end local function lpm_addon_list(type, id) local max_id = 4 - local result = { addons = { } } + local result = { [(type or "addon") .. "s"] = { } } for j,addon in ipairs(common.grep(system_bottle:all_addons(), function(p) return (not type or p.type == type) and (not id or p.id:find(id)) end)) do max_id = math.max(max_id, #addon.id) local repo = addon.repository - table.insert(result.addons, { + table.insert(result[(type or "addon") .. "s"], { id = addon.id, status = addon.repository and (addon:is_installed(system_bottle) and "installed" or (system_bottle.lite_xl:is_compatible(addon) and "available" or "incompatible")) or (addon:is_bundled(system_bottle) and "bundled" or (addon:is_core(system_bottle) and "core" or (addon:is_upgradable(system_bottle) and "upgradable" or "orphan"))), version = "" .. addon.version, @@ -1705,7 +1705,7 @@ It has the following commands: path can be specifeid. lpm lite-xl list Lists all installed versions of lite-xl. - lpm run [...addons] Sets up a "bottle" to run the specified + lpm run [...addons] Sets up a "bottle" to run the specified lite version, with the specified addons and then opens it. lpm describe [bottle] Describes the bottle specified in the form -- cgit v1.2.3