From 44bd3bd9d4d17841b4b9d17b30503559f3da1375 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 9 Nov 2021 21:14:08 +1000 Subject: Use releases from apt-panopticommon. --- apt-panopticon.lua | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 4019fdf..8543210 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -14,7 +14,6 @@ APT.html = true local defaultURL = {scheme = "http"} -local releases = {"jessie", "ascii", "beowulf", "ceres"} local releaseFiles = { -- Release file. @@ -454,7 +453,7 @@ local checkFiles = function (host, ip, path, file) if checkTimeouts(host, "https", ip .. path .. "/" .. s) then return end end end - for i, s in pairs(releases) do + for i, s in pairs(APT.releases) do for j, k in pairs(releaseFiles) do if repoExists(s .. k) then if checkTimeouts(host, "http", ip .. path .. "/merged/dists/" .. s .. '/' .. k) then return end @@ -568,7 +567,7 @@ local downloads = function(host, URL, meta, release, list) return end else - for i, s in pairs(releases) do + for i, s in pairs(APT.releases) do for j, k in pairs(releaseFiles) do if repoExists(s .. k) then addDownload(host, URL, f, s, k) @@ -678,7 +677,7 @@ local postParse = function(host, list) if APT.options.referenceSite.value == host then if nil ~= list then local sem = 'results/NEW_' .. list.out .. '_%s.txt' - for i, n in pairs(releases) do + for i, n in pairs(APT.releases) do local f = sem:format(n) if APT.checkFile(f .. '.tmp') then os.execute('mv ' .. f .. '.tmp ' .. f) @@ -691,7 +690,7 @@ local postParse = function(host, list) end local parseDebs = function(host) - for i, n in pairs(releases) do + for i, n in pairs(APT.releases) do local inFile = 'results/NEW_debs_' .. n .. '.txt' local nfile, e = io.open(inFile, "r") if nil == nfile then W("opening " .. inFile .. " file - " .. e) else @@ -733,7 +732,7 @@ end local parsePackages = function(host) local list = {inf = 'Packages', parser = parseDebs, out = 'debs', files = {}, nextf = ''} - for i, n in pairs(releases) do + for i, n in pairs(APT.releases) do local inFile = 'results/NEW_' .. list.inf .. '_' .. n .. '.txt' local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt' if APT.options.referenceSite.value == host then @@ -839,7 +838,7 @@ local parseRelease = function(host) local list = {inf = 'Release', parser = parsePackages, out = 'Packages', files = {}, nextf = 'debs'} local updated = false local now = tonumber(os.date('%s')) - for i, n in pairs(releases) do + for i, n in pairs(APT.releases) do for l, o in pairs(releaseFiles) do if repoExists(i .. o) then postDownload(host, n, o) @@ -922,7 +921,7 @@ end local parseStart = function(host) local list = {inf = '', parser = parseRelease, out = 'Release', files = {}, nextf = 'Packages'} - for i, n in pairs(releases) do + for i, n in pairs(APT.releases) do local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt' for l, o in pairs(releaseFiles) do if repoExists(n .. o) then @@ -1022,7 +1021,7 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. if (APT.options.referenceSite.value ~= host) and ('' ~= list.nextf) then local sem = 'results/NEW_' .. list.nextf .. '_%s.txt' - for i, n in pairs(releases) do + for i, n in pairs(APT.releases) do local f = sem:format(n) while not APT.checkFile(f) do D('*<* About to yield coroutine while waiting on - not APT.checkFile(' .. f .. ')') -- cgit v1.1