Skip to content

Commit

Permalink
Don't allow stubs to override non-stubs in our potential dependency l…
Browse files Browse the repository at this point in the history
…ist.
  • Loading branch information
adamharrison committed Jul 23, 2024
1 parent f5b150d commit a971de3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lpm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,9 @@ function Addon:get_compatibilities(bottle)
potential_addon:is_installed(bottle) or
(compare_version(compatible_addons[addon].version, potential_addon.version) and not compatible_addons[addon]:is_installed(bottle))
then
compatible_addons[addon] = potential_addon
if not compatible_addons[addon] or not potential_addon:is_stub() then
compatible_addons[addon] = potential_addon
end
end
else
incompatible_addons[addon] = incompatibilities
Expand Down Expand Up @@ -906,7 +908,7 @@ function Addon:install(bottle, installing)
local path = temporary_install_path .. (self.organization == 'complex' and self.path and system.stat(self.local_path).type ~= "dir" and (PATHSEP .. "init.lua") or "")
common.get(self.url, { target = path, checksum = self.checksum, callback = write_progress_bar })
if VERBOSE then log.action("Downloaded file " .. self.url .. " to " .. path) end
else -- local addon that has a local path
else -- local addon that has a local pathx
local temporary_path = temporary_install_path .. (self.organization == 'complex' and self.path and system.stat(self.local_path).type ~= "dir" and (PATHSEP .. "init.lua") or "")
if self.organization == 'complex' and self.path and common.stat(self.local_path).type ~= "dir" then common.mkdirp(temporary_install_path) end
if self.path then
Expand Down Expand Up @@ -1697,7 +1699,7 @@ function Bottle:get_addon(id, version, filter)
end
end
return table.unpack(common.sort(common.uniq(candidates), function (a,b)
return (a.replaces == id and b.replaces ~= id) or (a.version > b.version)
return (a.replaces == id and b.replaces ~= id) or (a.version > b.version) or (not a:is_stub() and b:is_stub())
end))
end

Expand Down

0 comments on commit a971de3

Please sign in to comment.