diff options
author | Gaspartcho <93390411+Gaspartcho@users.noreply.github.com> | 2024-02-25 20:15:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 14:15:55 -0500 |
commit | af0a2132c6914f9f2484ffdfd43a51d304053989 (patch) | |
tree | 5d17b32e87f504a38de1065d21548a725de04b8e | |
parent | 4f381aa35d66185b97bfba62d4002857660118f1 (diff) | |
download | lite-xl-plugin-manager-af0a2132c6914f9f2484ffdfd43a51d304053989.tar.gz lite-xl-plugin-manager-af0a2132c6914f9f2484ffdfd43a51d304053989.zip |
Checks if dependency is core beofore marking it as orphan (#76)
* checks if dependency is core beofore marking it as orphan
* creting new var actually not needed
-rw-r--r-- | src/lpm.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 3f2a6ab..645d5fc 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -932,10 +932,15 @@ function Addon:get_orphaned_dependencies(bottle) local installed_addons = system_bottle:installed_addons() for id, options in pairs(self.dependencies) do local dependency = bottle:get_addon(id, options.version) - if dependency and (dependency.type == "meta" or dependency:is_installed(bottle)) and not dependency:is_explicitly_installed(bottle) and #common.grep(installed_addons, function(addon) return addon ~= self and addon:depends_on(dependency) end) == 0 then - table.insert(t, dependency) - if dependency.type == "meta" then - t = common.concat(t, dependency:get_orphaned_dependencies(bottle)) + if dependency then + if ( dependency.type == "meta" or dependency:is_installed(bottle) ) + and #common.grep(installed_addons, function(addon) return addon ~= self and addon:depends_on(dependency) end) == 0 + and not ( dependency:is_explicitly_installed(bottle) or dependency:is_core(bottle) ) + then + table.insert(t, dependency) + if dependency.type == "meta" then + t = common.concat(t, dependency:get_orphaned_dependencies(bottle)) + end end end end |