Browse Source

Make a couple of convenience strings.

master
onefang 3 years ago
parent
commit
be99b28da3
  1. 18
      apt-panopticon.lua

18
apt-panopticon.lua

@ -826,24 +826,26 @@ local parseRelease = function(host)
end
end
if APT.checkFile('results/' .. host .. '/merged/dists/' .. n .. '/Release') then
os.execute('sort -k 3 results/' .. host .. '/merged/dists/' .. n .. '/Release >results/' .. host .. '/merged/dists/' .. n .. '/Release.SORTED')
local fR = 'results/' .. host .. '/merged/dists/' .. n .. '/Release'
local fRp = APT.options.referenceSite.value .. '/merged/dists/' .. n .. '/Release.SORTED'
if APT.checkFile(fR) then
os.execute('sort -k 3 ' .. fR .. ' >' .. fR .. '.SORTED')
local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt'
if APT.checkFile('results_old/' .. APT.options.referenceSite.value .. '/merged/dists/' .. n .. '/Release.SORTED') then
if APT.checkFile('results_old/' .. fRp) then
if APT.options.referenceSite.value == host then
outFile = outFile .. '.tmp'
os.execute('diff -U 0 results_old/' .. APT.options.referenceSite.value .. '/merged/dists/' .. n .. '/Release.SORTED ' ..
'results/' .. APT.options.referenceSite.value .. '/merged/dists/' .. n .. '/Release.SORTED ' ..
os.execute('diff -U 0 results_old/' .. fRp .. ' ' ..
'results/' .. fRp .. ' ' ..
'| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >' .. outFile)
-- TODO - Maybe check the date in Release, though since they are updated daily, is there any point? Perhaps it's for checking amprolla got run?
-- Also check if that date is in the future, apt recently got a check for that, though not sure why.
os.execute('rm -f results/' .. host .. '/merged/dists/' .. n .. '/Release 2>/dev/null; ')
os.execute('rm -f ' .. fR .. ' 2>/dev/null; ')
else
-- TODO - compare to the pkgmaster copy.
if APT.testing('Updated') then
local pkt = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' results/pkgmaster.devuan.org/merged/dists/]] .. n .. [[/Release.SORTED | cut -d ' ' -f 2-)" '+%s']]):Do().result
local pkt = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' results/]] .. fRp .. [[ | cut -d ' ' -f 2-)" '+%s']]):Do().result
pkt = tonumber(pkt:sub(2, -2))
local new = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' results/]] .. host .. [[/merged/dists/]] .. n .. [[/Release.SORTED | cut -d ' ' -f 2-)" '+%s']]):Do().result
local new = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' ]] .. fR .. [[.SORTED | cut -d ' ' -f 2-)" '+%s']]):Do().result
new = tonumber(new:sub(2, -2))
local upd = pkt + APT.mirrors[host].Updated
local updd = pkt + (APT.mirrors[host].Updated * 1.5) -- Give the mirror time to actually do the update.

Loading…
Cancel
Save