From 8c5baf96b0c674b3f6f9a42df72a05d0b8e58f84 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 26 Jun 2019 14:53:55 +1000 Subject: Change how the / at the end of the path is handled. --- mirror-checker.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mirror-checker.lua b/mirror-checker.lua index 8b80e3f..eb82a32 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua @@ -232,15 +232,16 @@ end local checkPaths = function (host, ip, path) I(" Checking IP " .. host .. " -> " .. ip .. " " .. path) for i, s in pairs(referenceDebs) do - if testing("http") then checkURL(host, "http://" .. ip .. path .. s) end - if testing("https") then checkURL(host, "https://" .. ip .. path .. s) end + if testing("http") then checkURL(host, "http://" .. ip .. path .. "/" .. s) end + if testing("https") then checkURL(host, "https://" .. ip .. path .. "/" .. s) end end for i, s in pairs(releases) do for j, k in pairs(releaseFiles) do - if testing("http") then checkURL(host, "http://" .. ip .. path .. "merged/dists/" .. s .. k) end - if testing("https") then checkURL(host, "https://" .. ip .. path .. "merged/dists/" .. s .. k) end if repoExists(s .. k) then + if testing("http") then checkURL(host, "http://" .. ip .. path .. "/merged/dists/" .. s .. k) end + if testing("https") then checkURL(host, "https://" .. ip .. path .. "/merged/dists/" .. s .. k) end + end end end end @@ -284,11 +285,6 @@ checkIP = function (orig, host, path, ip) end end -local checkHost = function (host, path, ip) - if nil == path then path = "/" else - checkIP(host, host, path, ip) -end - local downloads = function (cut, host, URL) if 0 ~= cut then cd = " --cut-dirs=" .. cut .. " " else cd = "" end if nil == URL then URL = "/" end -- cgit v1.1