aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-10-01 23:43:42 +1000
committeronefang2019-10-01 23:43:42 +1000
commit1f53f7be788b6e88def379c77fd67a3b25525d7c (patch)
treef36c4a250dc9c195efe012cb6b5bfafe5fb8fdfa
parentTODO++ (diff)
downloadapt-panopticon-1f53f7be788b6e88def379c77fd67a3b25525d7c.zip
apt-panopticon-1f53f7be788b6e88def379c77fd67a3b25525d7c.tar.gz
apt-panopticon-1f53f7be788b6e88def379c77fd67a3b25525d7c.tar.bz2
apt-panopticon-1f53f7be788b6e88def379c77fd67a3b25525d7c.tar.xz
Fork original mirror HEAD check to.
30 minutes to 3 minutes. B-)
-rwxr-xr-xmirror-checker.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/mirror-checker.lua b/mirror-checker.lua
index 7e9cfbe..9ff81a2 100755
--- a/mirror-checker.lua
+++ b/mirror-checker.lua
@@ -10,6 +10,7 @@ local args = {...}
10 They shouldn't have the proper certificate, but are giving a result anyway. 10 They shouldn't have the proper certificate, but are giving a result anyway.
11]] 11]]
12 12
13origin = false
13verbosity = -1 14verbosity = -1
14keep = false 15keep = false
15-- TODO - Should actually implement this. 16-- TODO - Should actually implement this.
@@ -284,6 +285,7 @@ checkHEAD = function (host, URL, r, retry)
284end 285end
285 286
286local checkFiles = function (host, ip, path, file) 287local checkFiles = function (host, ip, path, file)
288 if nil == path then path = "" end
287 if nil ~= file then 289 if nil ~= file then
288 if "redir" == ip then ip = host end 290 if "redir" == ip then ip = host end
289 I(" Checking IP for file " .. host .. " -> " .. ip .. " " .. path .. " " .. file) 291 I(" Checking IP for file " .. host .. " -> " .. ip .. " " .. path .. " " .. file)
@@ -328,7 +330,8 @@ checkHost = function (orig, host, path, ip, file)
328 else 330 else
329 if orig == host then 331 if orig == host then
330 D("checkHost " .. orig .. "" .. file) 332 D("checkHost " .. orig .. "" .. file)
331 checkFiles(orig, orig, path); 333-- checkFiles(orig, orig, path);
334 if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " -o " .. orig .. path .. " " .. file .." &") end
332 else D("checkHost " .. orig .. " -> " .. host) end 335 else D("checkHost " .. orig .. " -> " .. host) end
333 gatherIPs(ph.host) 336 gatherIPs(ph.host)
334 for k, v in pairs(IP[ph.host]) do 337 for k, v in pairs(IP[ph.host]) do
@@ -435,6 +438,8 @@ if 0 ~= #args then
435 keep = true 438 keep = true
436 elseif "-n" == a then 439 elseif "-n" == a then
437 fork = false 440 fork = false
441 elseif "-o" == a then
442 origin = true
438 elseif "--" == a:sub(1, 2) then 443 elseif "--" == a:sub(1, 2) then
439 local s, e = a:find("=") 444 local s, e = a:find("=")
440 if nil == s then e = -1 end 445 if nil == s then e = -1 end
@@ -524,7 +529,11 @@ if 0 < #arg then
524 checkExes(downloadLock) 529 checkExes(downloadLock)
525 end 530 end
526 end 531 end
527 checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) 532 if origin then
533 checkFiles(pu.host, pu.host, pu.path);
534 else
535 checkHost(pu.host, pu.host, pu.path, arg[2], arg[3])
536 end
528 logFile:close() 537 logFile:close()
529else 538else
530 if not keep then os.execute("rm -f results/*.log") end 539 if not keep then os.execute("rm -f results/*.log") end