From 4fede9e0117d40fd63ad3515cfeb2fd42c926ab4 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 26 Jun 2019 14:38:24 +1000 Subject: Add a check for non existing repos. --- mirror-checker.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mirror-checker.lua b/mirror-checker.lua index cd95135..cf53b7f 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua @@ -52,6 +52,10 @@ local releaseFiles = "-security/main/Contents-amd64.gz", "-security/main/Contents-arm64.gz", } +local notExist = +{ + "ceres-security" -- This will never exist, it's our code name for the testing suite. +} local referenceDebs = { -- Devuan package. NOTE this one likely should not get redirected, but that's more a warning than an error. @@ -131,6 +135,14 @@ local checkExes = function (exe) return tonumber(count) end +local repoExists = function (r) + r = r:match("([%a-]*)") + if nil == r then return false end + for k, v in pairs(notExist) do + if v == r then return false end + end + return true +end local IP = {} local gatherIPs = function (host) @@ -208,6 +220,7 @@ local checkPaths = function (host, ip, path) 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 end end end @@ -276,6 +289,8 @@ local downloads = function (host, URL, IP) cm = "ionice -c3 " .. download .. log:format(s, s) for j, k in pairs(releaseFiles) do cm = cm .. " https://" .. host .. URL .. "/merged/dists/" .. s .. k + if repoExists(s .. k) then + end end end execute(cm .. " &") -- cgit v1.1