diff options
-rw-r--r-- | SPEC.md | 3 | ||||
-rw-r--r-- | src/lpm.lua | 10 |
2 files changed, 10 insertions, 3 deletions
@@ -70,6 +70,7 @@ Fields that are required are bolded. with a dictionary, takes `ARCH` keys, and runs a different command per `ARCH`. * `url`: Optionally a URL which specifies a direct download link to a single lua file. precludes the use of `remote`, `path`. Usually a `singleton`. +* `checksum`: Provides a checksum to check against a `url`. * `extra`: Optionally a dictionary which holds any desired extra information. Any keys not present in this official listing render the manifest non-conforming. @@ -121,7 +122,7 @@ be extracted inside the addon's directory. Lite-XLs represent different version of lite-xl that are registered in this repository. Lite-XLs has the following metadata, as well as a `files` array. -* `version`: A version specifier. Must take the form of x.x(.x)(-suffix). +* `version`: A version specifier. Must take the form of x(.x)\*(-suffix). Suffixes can be used to denote different flavours of lite-xl. * `mod_version`: The modversion the binary corresponds to. 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 |