1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-11-09 03:58:08 +11:00
OC-KittenOS/inst/verify.lua

31 lines
691 B
Lua
Raw Normal View History

2020-03-31 03:47:27 +11:00
-- This is released into the public domain.
-- No warranty is provided, implied or otherwise.
-- Installer Compression Verification Tool --
local alg, tarName = ...
local u = require("libs.frw")
io.stderr:write("verifying... ")
local p = u.progress()
local tarData = u.read(tarName)
local total = ""
function M(t)
assert(#t == 512)
total = total .. t
p(#total / #tarData)
end
dofile(alg .. "/instdeco.lua")
L(u.read(alg .. "/output.bin"))
if total ~= tarData then
io.stderr:write("\n" .. #total .. " : " .. #tarData .. "\n")
u.write(alg .. "/vfyerr.bin", total)
error("VERIFICATION FAILURE : see inst/" .. alg .. "/vfyerr.bin!")
end
io.stderr:write("\nverification success\n")