1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-11-23 19:08:05 +11:00

quickly fix this (this is r5 now)

This commit is contained in:
20kdc 2018-07-28 16:50:35 +01:00
parent 27f7fe35da
commit 13d3abfd26

View File

@ -91,12 +91,11 @@ function opInstall(packageId, checked)
for _, v in ipairs(gback) do for _, v in ipairs(gback) do
local f = destProx.open(v .. ".C2T", "wb") local f = destProx.open(v .. ".C2T", "wb")
assert(f, "unable to create download file") assert(f, "unable to create download file")
xpcall(function () local ok, e = pcall(download, v, function (b)
destProx.close(f)
end, download, v, function (b)
assert(destProx.write(f, b or ""), "unable to save data") assert(destProx.write(f, b or ""), "unable to save data")
end, downloadSrc) end, downloadSrc)
destProx.close(f) destProx.close(f)
if not ok then error(e) end
end end
-- CRITICAL SECTION -- -- CRITICAL SECTION --
if destProx.exists("data/app-claw/" .. packageId .. ".c2x") then if destProx.exists("data/app-claw/" .. packageId .. ".c2x") then
@ -141,15 +140,16 @@ function opRemove(packageId, checked)
end end
end end
local function ender(...) local ok, e
if downloadSrc then
ok, e = pcall(opInstall, packageId, checked)
else
ok, e = pcall(opRemove, packageId, checked)
end
destProx = nil destProx = nil
downloadSrc = nil downloadSrc = nil
primaryINet = nil primaryINet = nil
neo.executeAsync("app-claw", packageId) neo.executeAsync("app-claw", packageId)
return ... if not ok then
end error(e)
if downloadSrc then
xpcall(ender, opInstall, packageId, checked)
else
xpcall(ender, opRemove, packageId, checked)
end end