From 9de868646f4f05d81922effd32b0051da493139a Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 23 Dec 2019 13:10:18 +1000 Subject: Forgotten code for the "dig in forks" changes. --- apt-panopticommon.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'apt-panopticommon.lua') diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index 9b62e9a..6aabfee 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -493,16 +493,18 @@ APT.collateAll = function(l, host, func) if nil ~= func then func(results) end local v = APT.mirrors[host] if nil ~= v then - 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(l, host, h, results) - if nil ~= func then func(results, h) end + local IPs = results.IPs + if nil == IPs then W('No IPs for ' .. host .. ' in ' .. l) else + for i, u in pairs(IPs) do + if "table" == type(u) then + for h, t in pairs(u) do + results = APT.collate(l, host, h, results) + if nil ~= func then func(results, h) end + end + else + results = APT.collate(l, host, i, results) + if nil ~= func then func(results, i) end end - else - results = APT.collate(l, host, i, results) - if nil ~= func then func(results, i) end end end end -- cgit v1.1