Verified Commit d859ed55 authored by Karel Koci's avatar Karel Koci 🤘

updater: drop missed content related code

This code was here because of package content option but this feature is
obsoleted and dropped so we can drop this code as well.
parent d3bd91ba
......@@ -139,7 +139,6 @@ local allowed_package_extras = {
["replan"] = utils.arr2set({"boolean", "string"}),
["abi_change"] = utils.arr2set({"table", "boolean"}),
["abi_change_deep"] = utils.arr2set({"table", "boolean"}),
["content"] = utils.arr2set({"string"}),
["priority"] = utils.arr2set({"number"}),
["ignore"] = utils.arr2set({"table"})
}
......
......@@ -99,30 +99,22 @@ function prepare(entrypoint)
-- Now push all data into the transaction
for _, task in ipairs(tasks) do
if task.action == "require" then
if task.package.data then -- package had content extra field and we already have data downloaded
INFO("Queue install of " .. task.name .. "//" .. task.package.Version)
transaction.queue_install_downloaded(task.package.data, task.name, task.package.Version, task.modifier)
else
local ok, data = task.real_uri:get()
if ok then
INFO("Queue install of " .. task.name .. "/" .. task.package.repo.name .. "/" .. task.package.Version)
if task.package.MD5Sum then
local sum = md5(data)
if sum ~= task.package.MD5Sum then
error(utils.exception("corruption", "The md5 sum of " .. task.name .. " does not match"))
end
end
if task.package.SHA256Sum then
local sum = sha256(data)
if sum ~= task.package.SHA256Sum then
error(utils.exception("corruption", "The sha256 sum of " .. task.name .. " does not match"))
end
end
transaction.queue_install_downloaded(data, task.name, task.package.Version, task.modifier)
else
error(data)
local ok, data = task.real_uri:get()
if not ok then error(data) end
INFO("Queue install of " .. task.name .. "/" .. task.package.repo.name .. "/" .. task.package.Version)
if task.package.MD5Sum then
local sum = md5(data)
if sum ~= task.package.MD5Sum then
error(utils.exception("corruption", "The md5 sum of " .. task.name .. " does not match"))
end
end
if task.package.SHA256Sum then
local sum = sha256(data)
if sum ~= task.package.SHA256Sum then
error(utils.exception("corruption", "The sha256 sum of " .. task.name .. " does not match"))
end
end
transaction.queue_install_downloaded(data, task.name, task.package.Version, task.modifier)
elseif task.action == "remove" then
INFO("Queue removal of " .. task.name)
transaction.queue_remove(task.name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment