diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2022-11-03 20:26:54 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2022-11-03 20:26:54 -0400 |
commit | 086cbe2a095b52bf44f2ac5e361152cb8e77dc1b (patch) | |
tree | 7883767123bdc5826b61ac1912a293699d2e7ad8 /src/lpm.lua | |
parent | c40793df85f402f26efab64c96387318a9c8c514 (diff) | |
download | lite-xl-plugin-manager-086cbe2a095b52bf44f2ac5e361152cb8e77dc1b.tar.gz lite-xl-plugin-manager-086cbe2a095b52bf44f2ac5e361152cb8e77dc1b.zip |
Added conflicts.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r-- | src/lpm.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 4dc1c01..8dfc8d8 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -508,6 +508,7 @@ function Plugin.new(repository, metadata) remote = nil, version = "1.0", dependencies = {}, + conflicts = {}, local_path = repository and (repository.local_path .. PATHSEP .. (repository.commit or repository.branch) .. (metadata.path and (PATHSEP .. metadata.path:gsub("^/", "")) or "")), }, metadata), Plugin) self.type = type @@ -526,7 +527,10 @@ end function Plugin:is_core(bottle) return self.type == "core" end function Plugin:is_bundled(bottle) return self.type == "bundled" end function Plugin:is_installed(bottle) return self:is_core(bottle) or (bottle.lite_xl:is_compatible(self) and system.stat(self:get_install_path(bottle))) end -function Plugin:is_incompatible(plugin) return self.dependencies[plugin.name] and not match_version(plugin.version, self.dependencies[plugin.name]) end +function Plugin:is_incompatible(plugin) + return (self.dependencies[plugin.name] and not match_version(plugin.version, self.dependencies[plugin.name] and self.dependencies[plugin.name].version)) or + (self.conflicts[plugin.name] and match_version(plugin.version, self.conflicts[plugin.name] and self.conflicts[plugin.name].version)) +end function Plugin:get_path(bottle) return self:is_installed(bottle) and self:get_install_path(bottle) or self.local_path |