aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2024-03-29 15:49:21 -0400
committerAdam Harrison <adamdharrison@gmail.com>2024-03-29 15:49:21 -0400
commitdd06ba252e662b6f7525e6a88fef3d55326c20c3 (patch)
treeeb42e26101bc62f44bc413752f8d8ca6e6cfd3d1
parent636fbcf54ef09eae0f5423ee9e6b326f7269c297 (diff)
downloadlite-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.
-rw-r--r--SPEC.md3
-rw-r--r--src/lpm.lua10
2 files changed, 10 insertions, 3 deletions
diff --git a/SPEC.md b/SPEC.md
index c6b2c57..71ca2a9 100644
--- a/SPEC.md
+++ b/SPEC.md
@@ -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