aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-12-04 03:56:49 +1000
committeronefang2019-12-04 03:56:49 +1000
commitbc3635178c333491f9c0a5ccdf2cd4b2054f4072 (patch)
tree7c520f9f4c60559e1872d35cea814f4cb158dbdd
parentSpeed range. (diff)
downloadapt-panopticon-bc3635178c333491f9c0a5ccdf2cd4b2054f4072.zip
apt-panopticon-bc3635178c333491f9c0a5ccdf2cd4b2054f4072.tar.gz
apt-panopticon-bc3635178c333491f9c0a5ccdf2cd4b2054f4072.tar.bz2
apt-panopticon-bc3635178c333491f9c0a5ccdf2cd4b2054f4072.tar.xz
Try to keep the old results directories small and clean.
Diffstat (limited to '')
-rwxr-xr-xapt-panopticon.lua71
1 files changed, 35 insertions, 36 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index 8566dad..7d263c7 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -682,49 +682,43 @@ local postDownload = function(host, r, k)
682-- TODO - should check the PGP sig of InRelease as well. 682-- TODO - should check the PGP sig of InRelease as well.
683 end 683 end
684 if testing("Integrity") or testing("Updated") then 684 if testing("Integrity") or testing("Updated") then
685 if options.referenceSite.value == host then 685 if "Packages." == file:sub(1, 9) then
686 if "Packages." == file:sub(1, 9) then
687-- TODO - compare the SHA256 sums in pkgmaster's Release for both the packed and unpacked versions. 686-- TODO - compare the SHA256 sums in pkgmaster's Release for both the packed and unpacked versions.
688-- Also note that this might get only a partial download due to maxtime. 687-- Also note that this might get only a partial download due to maxtime.
688 if options.referenceSite.value == host then
689 local Pp, e = io.open('results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed', "w+") 689 local Pp, e = io.open('results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed', "w+")
690 if nil == Pp then W('opening results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed' .. ' file - ' .. e) else 690 if nil == Pp then W('opening results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed' .. ' file - ' .. e) else
691 local pp = {} 691 local pp = {}
692 if checkFile('results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages') then 692 for l in io.lines('results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages') do
693 for l in io.lines('results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages') do 693 if "Package: " == l:sub(1, 9) then
694 if "Package: " == l:sub(1, 9) then 694 if 0 ~= #pp then
695 if 0 ~= #pp then 695 for i = 1, 6 do
696 Pp:write(r .. " | ") 696 if nil == pp[i] then print(host .. " " .. r .. " " .. dir .. " " .. i) else Pp:write(pp[i] .. " | ") end
697 for i = 1, 6 do
698 if nil == pp[i] then print(host .. " " .. r .. " " .. dir .. " " .. i) else Pp:write(pp[i] .. " | ") end
699 end
700 Pp:write("\n")
701 end 697 end
702 pp = {} 698 Pp:write("\n")
703 pp[1] = l:sub(10, -1)
704 elseif "Version: " == l:sub(1, 9) then
705 pp[2] = l:sub(10, -1)
706 elseif "Filename: " == l:sub(1, 10) then
707 pp[3] = l:sub(11, -1)
708 elseif "Size: " == l:sub(1, 6) then
709 pp[4] = l:sub(7, -1)
710 elseif "MD5sum: " == l:sub(1, 8) then
711 pp[5] = l:sub(9, -1)
712 elseif "SHA256: " == l:sub(1, 8) then
713 pp[6] = l:sub(9, -1)
714 end 699 end
700 pp = {}
701 pp[1] = l:sub(10, -1)
702 elseif "Version: " == l:sub(1, 9) then
703 pp[2] = l:sub(10, -1)
704 elseif "Filename: " == l:sub(1, 10) then
705 pp[3] = l:sub(11, -1)
706 elseif "Size: " == l:sub(1, 6) then
707 pp[4] = l:sub(7, -1)
708 elseif "MD5sum: " == l:sub(1, 8) then
709 pp[5] = l:sub(9, -1)
710 elseif "SHA256: " == l:sub(1, 8) then
711 pp[6] = l:sub(9, -1)
715 end 712 end
716 else
717 W("Can't find file results_old/pkgmaster.devuan.org/merged/dists/" .. r .. dir .. "Packages")
718 end 713 end
719 Pp:close() 714 Pp:close()
720 os.execute('sort results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed >results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed-sorted') 715 os.execute('sort results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed >results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages_parsed-sorted')
721 os.execute('rm results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed') 716 if checkFile('results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted') then
722 if checkFile('results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages.parsed-sorted') then 717 execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted ' ..
723 execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages.parsed-sorted ' .. 718 'results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted ' ..
724 'results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages.parsed-sorted ' ..
725 ' | grep -E "^-" | grep -Ev "^\\+\\+\\+|^---" >>results/OLD_PACKAGES_' .. r .. '.txt') 719 ' | grep -E "^-" | grep -Ev "^\\+\\+\\+|^---" >>results/OLD_PACKAGES_' .. r .. '.txt')
726 execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages.parsed-sorted ' .. 720 execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted ' ..
727 'results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages.parsed-sorted ' .. 721 'results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted ' ..
728 ' | grep -E "^\\+" | grep -Ev "^\\+\\+\\+|^---" >>results/NEW_Packages_' .. r .. '.txt') 722 ' | grep -E "^\\+" | grep -Ev "^\\+\\+\\+|^---" >>results/NEW_Packages_' .. r .. '.txt')
729 -- Find the smallest new package for each release. 723 -- Find the smallest new package for each release.
730 os.execute('sort -b -k 9,9 -n results/NEW_Packages_' .. r .. '.txt >results/NEW_Packages_' .. r .. '.sorted.txt') 724 os.execute('sort -b -k 9,9 -n results/NEW_Packages_' .. r .. '.txt >results/NEW_Packages_' .. r .. '.sorted.txt')
@@ -732,11 +726,12 @@ local postDownload = function(host, r, k)
732 os.execute('grep -s " | pool/DEBIAN-SECURITY/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >>results/NEW_Packages_' .. r .. '.test.txt') 726 os.execute('grep -s " | pool/DEBIAN-SECURITY/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >>results/NEW_Packages_' .. r .. '.test.txt')
733 os.execute('grep -s " | pool/DEVUAN/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >>results/NEW_Packages_' .. r .. '.test.txt') 727 os.execute('grep -s " | pool/DEVUAN/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >>results/NEW_Packages_' .. r .. '.test.txt')
734 else 728 else
735 W("Can't find file results_old/pkgmaster.devuan.org/merged/dists/" .. r .. dir .. "Packages.parsed-sorted") 729 C("Can't find file results_old/pkgmaster.devuan.org/merged/dists/" .. r .. dir .. "Packages_parsed-sorted")
736 end 730 end
737 end 731 end
738 os.execute('rm results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages')
739 end 732 end
733 os.execute('rm results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages')
734 os.execute('rm results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages.*')
740 end 735 end
741 end 736 end
742end 737end
@@ -796,7 +791,6 @@ local getMirrors = function ()
796 d = string.lower(d) 791 d = string.lower(d)
797 if "FQDN" == t then 792 if "FQDN" == t then
798 if "" ~= host then 793 if "" ~= host then
799-- if active then mirrors[host] = m end
800 mirrors[host] = m 794 mirrors[host] = m
801 m = {} 795 m = {}
802 active = true 796 active = true
@@ -982,6 +976,8 @@ if 0 < #arg then
982 execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' .. 976 execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' ..
983 'results/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' .. 977 'results/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' ..
984 '| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >results/NEW_Release_' .. n .. '.txt') 978 '| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >results/NEW_Release_' .. n .. '.txt')
979 os.execute('rm results/' .. pu.host .. '/merged/dists/' .. n .. '/Release')
980-- os.execute('rm results/' .. pu.host .. '/merged/dists/' .. n .. '/Release.SORTED')
985-- 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? 981-- 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?
986 else 982 else
987-- TODO - compare to the pkgmaster copy. 983-- TODO - compare to the pkgmaster copy.
@@ -1074,6 +1070,10 @@ if 0 < #arg then
1074 end 1070 end
1075 end 1071 end
1076 1072
1073 if origin and options.referenceSite.value ~= pu.host then
1074 if not keep then os.execute("rm -fr results/" .. pu.host) end
1075 os.execute('rm STATUS_' .. pu.host .. '* 2>/dev/null')
1076 end
1077 local f = pu.host 1077 local f = pu.host
1078 if "" ~= ip then f = f .. "_" .. ip end 1078 if "" ~= ip then f = f .. "_" .. ip end
1079 local rfile, e = io.open("results/" .. f .. ".lua", "w+") 1079 local rfile, e = io.open("results/" .. f .. ".lua", "w+")
@@ -1142,7 +1142,6 @@ else
1142 end 1142 end
1143 end 1143 end
1144 1144
1145-- os.execute("rm -f results/*.lua")
1146 logPost() 1145 logPost()
1147 logFile:close() 1146 logFile:close()
1148end 1147end