diff options
author | onefang | 2019-12-26 02:10:04 +1000 |
---|---|---|
committer | onefang | 2019-12-26 02:10:04 +1000 |
commit | 6f952a1e8dd51953942e2d1403312e2121126328 (patch) | |
tree | 911243d89fc1a308fa4ee8eaa8d14b1f57e41106 | |
parent | Add a Icinga/Nagios script. (diff) | |
download | apt-panopticon-6f952a1e8dd51953942e2d1403312e2121126328.zip apt-panopticon-6f952a1e8dd51953942e2d1403312e2121126328.tar.gz apt-panopticon-6f952a1e8dd51953942e2d1403312e2121126328.tar.bz2 apt-panopticon-6f952a1e8dd51953942e2d1403312e2121126328.tar.xz |
Fix up Updated time checks.
-rwxr-xr-x | apt-panopticon.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua index b7a35fc..d67e3d0 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua | |||
@@ -776,8 +776,6 @@ local parseRelease = function(host) | |||
776 | local status, now = APT.execute('TZ="GMT" date "+%s"', false) | 776 | local status, now = APT.execute('TZ="GMT" date "+%s"', false) |
777 | now = tonumber(now:sub(2, -2)) | 777 | now = tonumber(now:sub(2, -2)) |
778 | for i, n in pairs(releases) do | 778 | for i, n in pairs(releases) do |
779 | local status, old = APT.execute([[TZ="GMT" date -d "$(grep '^Date:' results_old/pkgmaster.devuan.org/merged/dists/]] .. n .. [[/Release.SORTED | cut -d ' ' -f 2-)" '+%s']], false) | ||
780 | old = tonumber(old:sub(2, -2)) | ||
781 | for l, o in pairs(releaseFiles) do | 779 | for l, o in pairs(releaseFiles) do |
782 | if repoExists(i .. o) then | 780 | if repoExists(i .. o) then |
783 | postDownload(host, n, o) | 781 | postDownload(host, n, o) |
@@ -808,10 +806,12 @@ local parseRelease = function(host) | |||
808 | else | 806 | else |
809 | -- TODO - compare to the pkgmaster copy. | 807 | -- TODO - compare to the pkgmaster copy. |
810 | if APT.testing('Updated') then | 808 | if APT.testing('Updated') then |
811 | local status, new = APT.execute([[TZ="GMT" date -d "$(grep '^Date:' results/]] .. host .. [[/merged/dists/]] .. n .. [[/Release.SORTED | cut -d ' ' -f 2-)" '+%s']], false) | 809 | local status, pkt = APT.execute([[TZ="GMT" date -d "$(grep '^Date:' results/pkgmaster.devuan.org/merged/dists/]] .. n .. [[/Release.SORTED | cut -d ' ' -f 2-)" '+%s']], false) |
810 | pkt = tonumber(pkt:sub(2, -2)) | ||
811 | local status, new = APT.execute([[TZ="GMT" date -d "$(grep '^Date:' results/]] .. host .. [[/merged/dists/]] .. n .. [[/Release.SORTED | cut -d ' ' -f 2-)" '+%s']], false) | ||
812 | new = tonumber(new:sub(2, -2)) | 812 | new = tonumber(new:sub(2, -2)) |
813 | local upd = old + APT.mirrors[host].Updated | 813 | local upd = pkt + APT.mirrors[host].Updated |
814 | if old ~= new then | 814 | if pkt > new then |
815 | if upd >= now then | 815 | if upd >= now then |
816 | W('Release ' .. n .. ' not updated yet, should update @ ' .. os.date('!%F %T', upd), 'http', 'Updated', host) | 816 | W('Release ' .. n .. ' not updated yet, should update @ ' .. os.date('!%F %T', upd), 'http', 'Updated', host) |
817 | else | 817 | else |