diff options
author | onefang | 2020-01-03 01:05:19 +1000 |
---|---|---|
committer | onefang | 2020-01-03 01:05:19 +1000 |
commit | be99b28da3cab12b0dfe65de6b3f1f6aa642b0f3 (patch) | |
tree | 8d4944009e11e4c98c49dc3a4e135b33e506f8bf | |
parent | Collate more data from the redirect results. (diff) | |
download | apt-panopticon-be99b28da3cab12b0dfe65de6b3f1f6aa642b0f3.zip apt-panopticon-be99b28da3cab12b0dfe65de6b3f1f6aa642b0f3.tar.gz apt-panopticon-be99b28da3cab12b0dfe65de6b3f1f6aa642b0f3.tar.bz2 apt-panopticon-be99b28da3cab12b0dfe65de6b3f1f6aa642b0f3.tar.xz |
Make a couple of convenience strings.
-rwxr-xr-x | apt-panopticon.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 6558474..582866b 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua | |||
@@ -826,24 +826,26 @@ local parseRelease = function(host) | |||
826 | end | 826 | end |
827 | end | 827 | end |
828 | 828 | ||
829 | if APT.checkFile('results/' .. host .. '/merged/dists/' .. n .. '/Release') then | 829 | local fR = 'results/' .. host .. '/merged/dists/' .. n .. '/Release' |
830 | os.execute('sort -k 3 results/' .. host .. '/merged/dists/' .. n .. '/Release >results/' .. host .. '/merged/dists/' .. n .. '/Release.SORTED') | 830 | local fRp = APT.options.referenceSite.value .. '/merged/dists/' .. n .. '/Release.SORTED' |
831 | if APT.checkFile(fR) then | ||
832 | os.execute('sort -k 3 ' .. fR .. ' >' .. fR .. '.SORTED') | ||
831 | local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt' | 833 | local outFile = 'results/NEW_' .. list.out .. '_' .. n .. '.txt' |
832 | if APT.checkFile('results_old/' .. APT.options.referenceSite.value .. '/merged/dists/' .. n .. '/Release.SORTED') then | 834 | if APT.checkFile('results_old/' .. fRp) then |
833 | if APT.options.referenceSite.value == host then | 835 | if APT.options.referenceSite.value == host then |
834 | outFile = outFile .. '.tmp' | 836 | outFile = outFile .. '.tmp' |
835 | os.execute('diff -U 0 results_old/' .. APT.options.referenceSite.value .. '/merged/dists/' .. n .. '/Release.SORTED ' .. | 837 | os.execute('diff -U 0 results_old/' .. fRp .. ' ' .. |
836 | 'results/' .. APT.options.referenceSite.value .. '/merged/dists/' .. n .. '/Release.SORTED ' .. | 838 | 'results/' .. fRp .. ' ' .. |
837 | '| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >' .. outFile) | 839 | '| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >' .. outFile) |
838 | -- 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? | 840 | -- 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? |
839 | -- Also check if that date is in the future, apt recently got a check for that, though not sure why. | 841 | -- Also check if that date is in the future, apt recently got a check for that, though not sure why. |
840 | os.execute('rm -f results/' .. host .. '/merged/dists/' .. n .. '/Release 2>/dev/null; ') | 842 | os.execute('rm -f ' .. fR .. ' 2>/dev/null; ') |
841 | else | 843 | else |
842 | -- TODO - compare to the pkgmaster copy. | 844 | -- TODO - compare to the pkgmaster copy. |
843 | if APT.testing('Updated') then | 845 | if APT.testing('Updated') then |
844 | 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 | 846 | local pkt = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' results/]] .. fRp .. [[ | cut -d ' ' -f 2-)" '+%s']]):Do().result |
845 | pkt = tonumber(pkt:sub(2, -2)) | 847 | pkt = tonumber(pkt:sub(2, -2)) |
846 | local new = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' results/]] .. host .. [[/merged/dists/]] .. n .. [[/Release.SORTED | cut -d ' ' -f 2-)" '+%s']]):Do().result | 848 | local new = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' ]] .. fR .. [[.SORTED | cut -d ' ' -f 2-)" '+%s']]):Do().result |
847 | new = tonumber(new:sub(2, -2)) | 849 | new = tonumber(new:sub(2, -2)) |
848 | local upd = pkt + APT.mirrors[host].Updated | 850 | local upd = pkt + APT.mirrors[host].Updated |
849 | local updd = pkt + (APT.mirrors[host].Updated * 1.5) -- Give the mirror time to actually do the update. | 851 | local updd = pkt + (APT.mirrors[host].Updated * 1.5) -- Give the mirror time to actually do the update. |