diff options
Diffstat (limited to '')
-rwxr-xr-x | apt-panopticon.lua | 17 |
1 files 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 | |||
14 | 14 | ||
15 | 15 | ||
16 | local defaultURL = {scheme = "http"} | 16 | local defaultURL = {scheme = "http"} |
17 | local releases = {"jessie", "ascii", "beowulf", "ceres"} | ||
18 | local releaseFiles = | 17 | local releaseFiles = |
19 | { | 18 | { |
20 | -- Release file. | 19 | -- Release file. |
@@ -454,7 +453,7 @@ local checkFiles = function (host, ip, path, file) | |||
454 | if checkTimeouts(host, "https", ip .. path .. "/" .. s) then return end | 453 | if checkTimeouts(host, "https", ip .. path .. "/" .. s) then return end |
455 | end | 454 | end |
456 | end | 455 | end |
457 | for i, s in pairs(releases) do | 456 | for i, s in pairs(APT.releases) do |
458 | for j, k in pairs(releaseFiles) do | 457 | for j, k in pairs(releaseFiles) do |
459 | if repoExists(s .. k) then | 458 | if repoExists(s .. k) then |
460 | if checkTimeouts(host, "http", ip .. path .. "/merged/dists/" .. s .. '/' .. k) then return end | 459 | 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) | |||
568 | return | 567 | return |
569 | end | 568 | end |
570 | else | 569 | else |
571 | for i, s in pairs(releases) do | 570 | for i, s in pairs(APT.releases) do |
572 | for j, k in pairs(releaseFiles) do | 571 | for j, k in pairs(releaseFiles) do |
573 | if repoExists(s .. k) then | 572 | if repoExists(s .. k) then |
574 | addDownload(host, URL, f, s, k) | 573 | addDownload(host, URL, f, s, k) |
@@ -678,7 +677,7 @@ local postParse = function(host, list) | |||
678 | if APT.options.referenceSite.value == host then | 677 | if APT.options.referenceSite.value == host then |
679 | if nil ~= list then | 678 | if nil ~= list then |
680 | local sem = 'results/NEW_' .. list.out .. '_%s.txt' | 679 | local sem = 'results/NEW_' .. list.out .. '_%s.txt' |
681 | for i, n in pairs(releases) do | 680 | for i, n in pairs(APT.releases) do |
682 | local f = sem:format(n) | 681 | local f = sem:format(n) |
683 | if APT.checkFile(f .. '.tmp') then | 682 | if APT.checkFile(f .. '.tmp') then |
684 | os.execute('mv ' .. f .. '.tmp ' .. f) | 683 | os.execute('mv ' .. f .. '.tmp ' .. f) |
@@ -691,7 +690,7 @@ local postParse = function(host, list) | |||
691 | end | 690 | end |
692 | 691 | ||
693 | local parseDebs = function(host) | 692 | local parseDebs = function(host) |
694 | for i, n in pairs(releases) do | 693 | for i, n in pairs(APT.releases) do |
695 | local inFile = 'results/NEW_debs_' .. n .. '.txt' | 694 | local inFile = 'results/NEW_debs_' .. n .. '.txt' |
696 | local nfile, e = io.open(inFile, "r") | 695 | local nfile, e = io.open(inFile, "r") |
697 | if nil == nfile then W("opening " .. inFile .. " file - " .. e) else | 696 | if nil == nfile then W("opening " .. inFile .. " file - " .. e) else |
@@ -733,7 +732,7 @@ end | |||
733 | 732 | ||
734 | local parsePackages = function(host) | 733 | local parsePackages = function(host) |
735 | local list = {inf = 'Packages', parser = parseDebs, out = 'debs', files = {}, nextf = ''} | 734 | local list = {inf = 'Packages', parser = parseDebs, out = 'debs', files = {}, nextf = ''} |
736 | for i, n in pairs(releases) do | 735 | for i, n in pairs(APT.releases) do |
737 | local inFile = 'results/NEW_' .. list.inf .. '_' .. n .. '.txt' | 736 | local inFile = 'results/NEW_' .. list.inf .. '_' .. n .. '.txt' |
738 | local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt' | 737 | local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt' |
739 | if APT.options.referenceSite.value == host then | 738 | if APT.options.referenceSite.value == host then |
@@ -839,7 +838,7 @@ local parseRelease = function(host) | |||
839 | local list = {inf = 'Release', parser = parsePackages, out = 'Packages', files = {}, nextf = 'debs'} | 838 | local list = {inf = 'Release', parser = parsePackages, out = 'Packages', files = {}, nextf = 'debs'} |
840 | local updated = false | 839 | local updated = false |
841 | local now = tonumber(os.date('%s')) | 840 | local now = tonumber(os.date('%s')) |
842 | for i, n in pairs(releases) do | 841 | for i, n in pairs(APT.releases) do |
843 | for l, o in pairs(releaseFiles) do | 842 | for l, o in pairs(releaseFiles) do |
844 | if repoExists(i .. o) then | 843 | if repoExists(i .. o) then |
845 | postDownload(host, n, o) | 844 | postDownload(host, n, o) |
@@ -922,7 +921,7 @@ end | |||
922 | 921 | ||
923 | local parseStart = function(host) | 922 | local parseStart = function(host) |
924 | local list = {inf = '', parser = parseRelease, out = 'Release', files = {}, nextf = 'Packages'} | 923 | local list = {inf = '', parser = parseRelease, out = 'Release', files = {}, nextf = 'Packages'} |
925 | for i, n in pairs(releases) do | 924 | for i, n in pairs(APT.releases) do |
926 | local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt' | 925 | local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt' |
927 | for l, o in pairs(releaseFiles) do | 926 | for l, o in pairs(releaseFiles) do |
928 | if repoExists(n .. o) then | 927 | if repoExists(n .. o) then |
@@ -1022,7 +1021,7 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. | |||
1022 | 1021 | ||
1023 | if (APT.options.referenceSite.value ~= host) and ('' ~= list.nextf) then | 1022 | if (APT.options.referenceSite.value ~= host) and ('' ~= list.nextf) then |
1024 | local sem = 'results/NEW_' .. list.nextf .. '_%s.txt' | 1023 | local sem = 'results/NEW_' .. list.nextf .. '_%s.txt' |
1025 | for i, n in pairs(releases) do | 1024 | for i, n in pairs(APT.releases) do |
1026 | local f = sem:format(n) | 1025 | local f = sem:format(n) |
1027 | while not APT.checkFile(f) do | 1026 | while not APT.checkFile(f) do |
1028 | D('*<* About to yield coroutine while waiting on - not APT.checkFile(' .. f .. ')') | 1027 | D('*<* About to yield coroutine while waiting on - not APT.checkFile(' .. f .. ')') |