From 36e374188e739b00d9089820cee26c04266d8d5b Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 24 Nov 2019 04:29:01 +1000 Subject: Clean up DNS-RR report spacing. --- apt-panopticon-report-web.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/apt-panopticon-report-web.lua b/apt-panopticon-report-web.lua index fa6df4d..78e631f 100755 --- a/apt-panopticon-report-web.lua +++ b/apt-panopticon-report-web.lua @@ -252,21 +252,30 @@ if nil == file then C("opening mirrors file - " .. e) else local integrity = "[skip]" local updated = "[skip]" + -- DNS-RR test. if "deb.devuan.org" ~= k then for l, w in pairs(mirrors[k].IPs) do if type(w) == "table" then for i, u in pairs(w) do if nil ~= mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][i] then - dns = dns .. " " .. logCount("deb.devuan.org", i) + local log = logCount("deb.devuan.org", l) + if "" ~= log then + if "" == dns then dns = " " else dns = dns .. " " end + dns = dns .. logCount("deb.devuan.org", i) + end end end else if nil ~= mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][l] then - dns = dns .. " " .. logCount("deb.devuan.org", l) + local log = logCount("deb.devuan.org", l) + if "" ~= log then + if "" == dns then dns = " " else dns = dns .. " " end + dns = dns .. log + end end end end - if "" == dns then dns = "DNS-RR: [no]" else dns = "DNS-RR: " .. dns end + if "" == dns then dns = "DNS-RR: [no]" else dns = "DNS-RR:" .. dns end end file:write("