aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mirror-checker.lua
diff options
context:
space:
mode:
authoronefang2019-11-05 00:09:10 +1000
committeronefang2019-11-05 00:09:10 +1000
commit03b0b5288022bd24a13f431de21d321a7483001c (patch)
tree22464f79915a56ae8cae696d44f5b332712acfd7 /mirror-checker.lua
parentGather the IPs and stuff them into mirrors.lua before forking. (diff)
downloadapt-panopticon-03b0b5288022bd24a13f431de21d321a7483001c.zip
apt-panopticon-03b0b5288022bd24a13f431de21d321a7483001c.tar.gz
apt-panopticon-03b0b5288022bd24a13f431de21d321a7483001c.tar.bz2
apt-panopticon-03b0b5288022bd24a13f431de21d321a7483001c.tar.xz
Add the round robin stuff to the mirrors.lua, and jiggle the code that loops through mirrors.
Diffstat (limited to '')
-rwxr-xr-xmirror-checker.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/mirror-checker.lua b/mirror-checker.lua
index 6580190..3da8bc6 100755
--- a/mirror-checker.lua
+++ b/mirror-checker.lua
@@ -443,6 +443,9 @@ local getMirrors = function ()
443 mirrors[host] = m 443 mirrors[host] = m
444 end 444 end
445 end 445 end
446 mirrors[options.roundRobin.value] = { ["Protocols"] = { ["http"] = true; ["https"] = true; }; ["FQDN"] = 'deb.devuan.org'; ["Active"] = 'yes'; ["BaseURL"] = 'deb.devuan.org'; }
447 gatherIPs(options.roundRobin.value)
448 mirrors[options.roundRobin.value].IPs = IP[options.roundRobin.value]
446 local file, e = io.open("results/mirrors.lua", "w+") 449 local file, e = io.open("results/mirrors.lua", "w+")
447 if nil == file then C("opening mirrors file - " .. e) else 450 if nil == file then C("opening mirrors file - " .. e) else
448 file:write(dumpTable(mirrors, "", "mirrors") .. "\nreturn mirrors\n") 451 file:write(dumpTable(mirrors, "", "mirrors") .. "\nreturn mirrors\n")
@@ -575,9 +578,7 @@ else
575 I("Starting tests " .. table.concat(options.tests.value, ", ")) 578 I("Starting tests " .. table.concat(options.tests.value, ", "))
576 execute("mkdir -p results") 579 execute("mkdir -p results")
577 mirrors = getMirrors() 580 mirrors = getMirrors()
578 mirrors[options.referenceSite.value] = nil
579 checkHost(options.referenceSite.value) 581 checkHost(options.referenceSite.value)
580 checkHost("deb.devuan.org")
581 for k, m in pairs(mirrors) do 582 for k, m in pairs(mirrors) do
582 if "/" == m.BaseURL:sub(-1, -1) then 583 if "/" == m.BaseURL:sub(-1, -1) then
583 W("slash at end of BaseURL in mirror_list.txt! " .. m.BaseURL) 584 W("slash at end of BaseURL in mirror_list.txt! " .. m.BaseURL)
@@ -588,9 +589,11 @@ else
588 m.BaseURL = m.BaseURL:sub(1, -2) 589 m.BaseURL = m.BaseURL:sub(1, -2)
589 end 590 end
590 local pu = url.parse("http://" .. m.BaseURL) 591 local pu = url.parse("http://" .. m.BaseURL)
591 checkHost(m.BaseURL) 592 if options.referenceSite.value ~= pu.host then
592 checkExes("mirror-checker.lua " .. sendArgs) 593 checkHost(m.BaseURL)
593 if testing("Integrity") or testing("Updated") then checkExes(downloadLock) end 594 checkExes("mirror-checker.lua " .. sendArgs)
595 if testing("Integrity") or testing("Updated") then checkExes(downloadLock) end
596 end
594 end 597 end
595 while 1 <= checkExes("mirror-checker.lua " .. sendArgs) do os.execute("sleep 10") end 598 while 1 <= checkExes("mirror-checker.lua " .. sendArgs) do os.execute("sleep 10") end
596 if testing("Integrity") or testing("Updated") then 599 if testing("Integrity") or testing("Updated") then