aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon-report-email-web.lua
diff options
context:
space:
mode:
authoronefang2019-12-29 10:16:06 +1000
committeronefang2019-12-29 10:16:06 +1000
commit393eb13e81d2f0f88acb4b83e132124c3d376401 (patch)
tree8f7d0ea5989e20fde17b8433f88d0ba2f0251f25 /apt-panopticon-report-email-web.lua
parentMinor cleanups, no logic changes. (diff)
downloadapt-panopticon-393eb13e81d2f0f88acb4b83e132124c3d376401.zip
apt-panopticon-393eb13e81d2f0f88acb4b83e132124c3d376401.tar.gz
apt-panopticon-393eb13e81d2f0f88acb4b83e132124c3d376401.tar.bz2
apt-panopticon-393eb13e81d2f0f88acb4b83e132124c3d376401.tar.xz
Refactor nested pairs() calls.
Diffstat (limited to 'apt-panopticon-report-email-web.lua')
-rwxr-xr-xapt-panopticon-report-email-web.lua82
1 files changed, 22 insertions, 60 deletions
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index 7d5ce7f..5598515 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -205,33 +205,20 @@ if nil == email then C("opening mirrors file - " .. e) else
205 205
206 -- DNS-RR test. 206 -- DNS-RR test.
207 if ("deb.devuan.org" ~= k) and (nil ~= APT.mirrors["deb.devuan.org"]) then 207 if ("deb.devuan.org" ~= k) and (nil ~= APT.mirrors["deb.devuan.org"]) then
208 for l, w in pairs(APT.mirrors[k].IPs) do 208 APT.allpairs(APT.mirrors[k].IPs,
209 if type(w) == "table" then 209 function(i, w, k, v)
210 for i, u in pairs(w) do 210 if nil ~= APT.mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][i] then
211 if nil ~= APT.mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][i] then 211 local log = logCount("deb.devuan.org", i)
212 local log = logCount("deb.devuan.org", i)
213 if "" ~= log then
214 if "" == dns then dns = " " else dns = dns .. " " end
215 dns = dns .. logCount("deb.devuan.org", i)
216 else
217 if "" == dns then dns = " " else dns = dns .. " " end
218 dns = dns .. i
219 end
220 end
221 end
222 else
223 if nil ~= APT.mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][l] then
224 local log = logCount("deb.devuan.org", l)
225 if "" ~= log then 212 if "" ~= log then
226 if "" == dns then dns = " " else dns = dns .. " " end 213 if "" == dns then dns = " " else dns = dns .. " " end
227 dns = dns .. log 214 dns = dns .. logCount("deb.devuan.org", i)
228 else 215 else
229 if "" == dns then dns = " " else dns = dns .. " " end 216 if "" == dns then dns = " " else dns = dns .. " " end
230 dns = dns .. l 217 dns = dns .. i
231 end 218 end
232 end 219 end
233 end 220 end
234 end 221 )
235 if "" == dns then dns = "[no]" end 222 if "" == dns then dns = "[no]" end
236 dns = " DNS-RR: " .. dns 223 dns = " DNS-RR: " .. dns
237 end 224 end
@@ -396,33 +383,20 @@ if nil == web then C("opening mirrors file - " .. e) else
396 383
397 -- DNS-RR test. 384 -- DNS-RR test.
398 if ("deb.devuan.org" ~= k) and (nil ~= APT.mirrors["deb.devuan.org"]) then 385 if ("deb.devuan.org" ~= k) and (nil ~= APT.mirrors["deb.devuan.org"]) then
399 for l, w in pairs(APT.mirrors[k].IPs) do 386 APT.allpairs(APT.mirrors[k].IPs,
400 if type(w) == "table" then 387 function(i, w, k, v)
401 for i, u in pairs(w) do 388 if nil ~= APT.mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][i] then
402 if nil ~= APT.mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][i] then 389 local log = logCount("deb.devuan.org", i)
403 local log = logCount("deb.devuan.org", i)
404 if "" ~= log then
405 if "" == dns then dns = " " else dns = dns .. "   " end
406 dns = dns .. logCount("deb.devuan.org", i)
407 else
408 if "" == dns then dns = " " else dns = dns .. "   " end
409 dns = dns .. "<font color='maroon'><b>" .. i .. "</b></font>"
410 end
411 end
412 end
413 else
414 if nil ~= APT.mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][l] then
415 local log = logCount("deb.devuan.org", l)
416 if "" ~= log then 390 if "" ~= log then
417 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end 391 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end
418 dns = dns .. log 392 dns = dns .. logCount("deb.devuan.org", i)
419 else 393 else
420 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end 394 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end
421 dns = dns .. "<font color='maroon'><b>" .. l .. "</b></font>" 395 dns = dns .. "<font color='maroon'><b>" .. i .. "</b></font>"
422 end 396 end
423 end 397 end
424 end 398 end
425 end 399 )
426 if "" == dns then dns = "<font color='grey'><b>no</b></font>" end 400 if "" == dns then dns = "<font color='grey'><b>no</b></font>" end
427 401
428 if 0 == max then 402 if 0 == max then
@@ -495,6 +469,7 @@ if nil == web then C("opening mirrors file - " .. e) else
495 APT.mirrors[k].BaseURL = nil 469 APT.mirrors[k].BaseURL = nil
496 APT.mirrors[k].Country = nil 470 APT.mirrors[k].Country = nil
497 APT.mirrors[k].Bandwidth = nil 471 APT.mirrors[k].Bandwidth = nil
472
498 for l, w in pairs(APT.mirrors[k].IPs) do 473 for l, w in pairs(APT.mirrors[k].IPs) do
499 if type(w) == "table" then 474 if type(w) == "table" then
500 n[l] = {} 475 n[l] = {}
@@ -564,33 +539,20 @@ if nil == web then C("opening mirrors file - " .. e) else
564 539
565 -- DNS-RR test. 540 -- DNS-RR test.
566 if ("deb.devuan.org" ~= k) and (nil ~= APT.debians["deb.devuan.org"]) then 541 if ("deb.devuan.org" ~= k) and (nil ~= APT.debians["deb.devuan.org"]) then
567 for l, w in pairs(APT.debians[k].IPs) do 542 APT.allpairs(APT.debians[k].IPs,
568 if type(w) == "table" then 543 function(i, w, k, v)
569 for i, u in pairs(w) do 544 if nil ~= APT.mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][i] then
570 if nil ~= APT.debians["deb.devuan.org"].IPs["deb.roundr.devuan.org"][i] then 545 local log = logCount("deb.devuan.org", i)
571 local log = logCount("deb.devuan.org", i)
572 if "" ~= log then
573 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end
574 dns = dns .. logCount("deb.devuan.org", i)
575 else
576 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end
577 dns = dns .. "<font color='maroon'><b>" .. i .. "</b></font>"
578 end
579 end
580 end
581 else
582 if nil ~= APT.debians["deb.devuan.org"].IPs["deb.roundr.devuan.org"][l] then
583 local log = logCount("deb.devuan.org", l)
584 if "" ~= log then 546 if "" ~= log then
585 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end 547 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end
586 dns = dns .. log 548 dns = dns .. logCount("deb.devuan.org", i)
587 else 549 else
588 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end 550 if "" == dns then dns = " " else dns = dns .. " &nbsp; " end
589 dns = dns .. "<font color='maroon'><b>" .. l .. "</b></font>" 551 dns = dns .. "<font color='maroon'><b>" .. i .. "</b></font>"
590 end 552 end
591 end 553 end
592 end 554 end
593 end 555 )
594 if "" == dns then dns = "<font color='grey'><b>no</b></font>" end 556 if "" == dns then dns = "<font color='grey'><b>no</b></font>" end
595 557
596 if 0 == max then 558 if 0 == max then