aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-06-26 14:38:24 +1000
committeronefang2019-06-26 14:38:24 +1000
commit4fede9e0117d40fd63ad3515cfeb2fd42c926ab4 (patch)
treef0bdd838a7aabd7e0ff553e0ecd52d4475195111
parentMore fixes of the logging. (diff)
downloadapt-panopticon-4fede9e0117d40fd63ad3515cfeb2fd42c926ab4.zip
apt-panopticon-4fede9e0117d40fd63ad3515cfeb2fd42c926ab4.tar.gz
apt-panopticon-4fede9e0117d40fd63ad3515cfeb2fd42c926ab4.tar.bz2
apt-panopticon-4fede9e0117d40fd63ad3515cfeb2fd42c926ab4.tar.xz
Add a check for non existing repos.
Diffstat (limited to '')
-rwxr-xr-xmirror-checker.lua15
1 files changed, 15 insertions, 0 deletions
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 =
52 "-security/main/Contents-amd64.gz", 52 "-security/main/Contents-amd64.gz",
53 "-security/main/Contents-arm64.gz", 53 "-security/main/Contents-arm64.gz",
54} 54}
55local notExist =
56{
57 "ceres-security" -- This will never exist, it's our code name for the testing suite.
58}
55local referenceDebs = 59local referenceDebs =
56{ 60{
57 -- Devuan package. NOTE this one likely should not get redirected, but that's more a warning than an error. 61 -- 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)
131 return tonumber(count) 135 return tonumber(count)
132end 136end
133 137
138local repoExists = function (r)
139 r = r:match("([%a-]*)")
140 if nil == r then return false end
141 for k, v in pairs(notExist) do
142 if v == r then return false end
143 end
144 return true
145end
134 146
135local IP = {} 147local IP = {}
136local gatherIPs = function (host) 148local gatherIPs = function (host)
@@ -208,6 +220,7 @@ local checkPaths = function (host, ip, path)
208 for j, k in pairs(releaseFiles) do 220 for j, k in pairs(releaseFiles) do
209 if testing("http") then checkURL(host, "http://" .. ip .. path .. "merged/dists/" .. s .. k) end 221 if testing("http") then checkURL(host, "http://" .. ip .. path .. "merged/dists/" .. s .. k) end
210 if testing("https") then checkURL(host, "https://" .. ip .. path .. "merged/dists/" .. s .. k) end 222 if testing("https") then checkURL(host, "https://" .. ip .. path .. "merged/dists/" .. s .. k) end
223 if repoExists(s .. k) then
211 end 224 end
212 end 225 end
213end 226end
@@ -276,6 +289,8 @@ local downloads = function (host, URL, IP)
276 cm = "ionice -c3 " .. download .. log:format(s, s) 289 cm = "ionice -c3 " .. download .. log:format(s, s)
277 for j, k in pairs(releaseFiles) do 290 for j, k in pairs(releaseFiles) do
278 cm = cm .. " https://" .. host .. URL .. "/merged/dists/" .. s .. k 291 cm = cm .. " https://" .. host .. URL .. "/merged/dists/" .. s .. k
292 if repoExists(s .. k) then
293 end
279 end 294 end
280 end 295 end
281 execute(cm .. " &") 296 execute(cm .. " &")