From beef318bc3f330bb45541e59672f349a6cb5233b Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 12 Dec 2019 13:53:47 +1000 Subject: Some refactoring of the results data handling. --- apt-panopticon-report-email-web.lua | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'apt-panopticon-report-email-web.lua') diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index 6319d1e..c19d211 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua @@ -160,18 +160,8 @@ if nil == email then C("opening mirrors file - " .. e) else "==== package mirror status " .. os.date("!%Y-%m-%d %H:%M") .. " GMT ====\n" .. "[skip] means that the test hasn't been written yet.\n\n") for k, v in APT.orderedPairs(APT.mirrors) do - local results = loadfile("results/" .. k .. ".lua")() email:write(k .. "....\n") - local IPs = v.IPs - for i, u in pairs(IPs) do - if "table" == type(u) then - for h, t in pairs(u) do - results = APT.collate(k, h, results) - end - else - results = APT.collate(k, i, results) - end - end + local results = APT.collateAll('results', k) local ftp = "[skip]" local http = status(k, results, "http") local https = status(k, results, "https") @@ -325,7 +315,7 @@ if nil == web then C("opening mirrors file - " .. e) else "ProtocolURL sanityIntegrityUpdatedSpeed range\n" ) for k, v in APT.orderedPairs(APT.mirrors) do - local results = loadfile("results/" .. k .. ".lua")() + local results = APT.collateAll('results', k) local active = "" if "yes" == v.Active then web:write(" " .. k .. " ") @@ -333,16 +323,6 @@ if nil == web then C("opening mirrors file - " .. e) else if nil == v.Active then active = 'nil' else active = v.Active end web:write(" " .. k .. " ") end - local IPs = v.IPs - for i, u in pairs(IPs) do - if "table" == type(u) then - for h, t in pairs(u) do - results = APT.collate(k, h, results) - end - else - results = APT.collate(k, i, results) - end - end local ftp = "[skip]" local http = status(k, results, "http") local https = status(k, results, "https") -- cgit v1.1