diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2024-03-29 15:49:21 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2024-03-29 15:49:21 -0400 |
commit | dd06ba252e662b6f7525e6a88fef3d55326c20c3 (patch) | |
tree | eb42e26101bc62f44bc413752f8d8ca6e6cfd3d1 /src/lpm.lua | |
parent | 636fbcf54ef09eae0f5423ee9e6b326f7269c297 (diff) | |
download | lite-xl-plugin-manager-dd06ba252e662b6f7525e6a88fef3d55326c20c3.tar.gz lite-xl-plugin-manager-dd06ba252e662b6f7525e6a88fef3d55326c20c3.zip |
Updated SPEC to incude `checksum` at an addon level, and added in a warning when explicit repositories are specified, but not used.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r-- | src/lpm.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 3dc06fa..8959f87 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1810,6 +1810,7 @@ function lpm.lite_xl_run(version, ...) if is_argument_repo(str) then table.insert(repositories, 1, Repository.url(str):add(AUTO_PULL_REMOTES)) system_bottle:invalidate_cache() + repositories[1].explicit = true else local id, version = common.split(":", str) local potentials = { system_bottle:get_addon(id, version, { mod_version = lite_xl.mod_version }) } @@ -1817,13 +1818,18 @@ function lpm.lite_xl_run(version, ...) local found_one = false for i, addon in ipairs(potentials) do if addon:is_core(system_bottle) then - uniq[addon.id] = true + uniq[addon.id] = addon found_one = true elseif not addon:is_orphan(system_bottle) and not uniq[addon.id] then table.insert(addons, addon) - uniq[addon.id] = true + uniq[addon.id] = addon found_one = true end + + if i > 1 and uniq[addon.id] and uniq[addon.id] ~= addon and addon.repository and addon.repository.explicit then + log.warning("your explicitly specified repository " .. addon.repository:url() .. " has a version of " .. addon.id .. " lower than that in " .. uniq[addon.id].repository:url() .. " (" .. addon.version .. " vs. " .. uniq[addon.id].version .. + "; in order to use the one in your specified repo, please specify " .. addon.id .. ":" .. addon.version) + end end if not found_one then error("can't find addon " .. str) end end |