diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2022-11-26 16:20:59 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2022-11-29 18:39:46 -0500 |
commit | fc0c4ed9a3103e0e6534311923668879fc8e0875 (patch) | |
tree | 6e7723c3f45d39f06c243d9c18a3c038da948793 /src/lpm.lua | |
parent | 3836606e2b735ba7b2dc0f580231843660587fb4 (diff) | |
download | lite-xl-plugin-manager-fc0c4ed9a3103e0e6534311923668879fc8e0875.tar.gz lite-xl-plugin-manager-fc0c4ed9a3103e0e6534311923668879fc8e0875.zip |
Removed openssl, and curl, and added mbedded tls.curl-removal
Almost fully removed curl, needs more testing.
Fixed most issues, now trying to cross compile.
Fix?
Sigh.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r-- | src/lpm.lua | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index cff5562..02738a8 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -459,7 +459,10 @@ local function prompt(message) end function common.get(source, target, checksum) - if not checksum then return system.get(source, target) end + local _, _, protocol, hostname, port, rest = source:find("^(https?)://([^:/?]+):?(%d*)(.*)$") + if not protocol then error("malfomed url " .. source) end + if not port or port == "" then port = protocol == "https" and 443 or 80 end + if not checksum then return system.get(protocol, hostname, port, rest, target) end if not system.stat(CACHEDIR .. PATHSEP .. "files") then common.mkdirp(CACHEDIR .. PATHSEP .. "files") end local cache_path = CACHEDIR .. PATHSEP .. "files" .. PATHSEP .. checksum if not system.stat(cache_path) then @@ -1611,15 +1614,25 @@ Flags have the following effects: "/etc/openssl/certs", -- NetBSD "/var/ssl/certs", -- AIX } - for i, path in ipairs(paths) do - local stat = system.stat(path) - if stat then - system.certs(stat.type, path) - break + if PLATFORM == "windows" then + system.certs("system", TMPDIR .. "certs.crt") + else + for i, path in ipairs(paths) do + local stat = system.stat(path) + if stat then + system.certs(stat.type, path) + break + end end end end + if ARGS[2] == "download" then + local file = common.get("https://raw.githubusercontent.com/adamharrison/lite-xl-simplified/master/manifest.json"); + print(file) + os.exit(0) + end + -- Base setup; initialize default repos if applicable, read them in. Determine Lite XL system binary if not specified, and pull in a list of all local lite-xl's. lpm_repo_init() |