aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-12-12 18:47:45 +1000
committeronefang2019-12-12 18:47:45 +1000
commit19fe4bce053bd0e6be67a3ea4e1a35360e2d70cc (patch)
treef0a8b7b1560ef96beb9fa5fe2ea85b15082b4291
parentTODO++ (diff)
downloadapt-panopticon-19fe4bce053bd0e6be67a3ea4e1a35360e2d70cc.zip
apt-panopticon-19fe4bce053bd0e6be67a3ea4e1a35360e2d70cc.tar.gz
apt-panopticon-19fe4bce053bd0e6be67a3ea4e1a35360e2d70cc.tar.bz2
apt-panopticon-19fe4bce053bd0e6be67a3ea4e1a35360e2d70cc.tar.xz
Speed up things by being clever.
Don't wait for pkgmaster to be completely finished, wait for the things we need to wait for. Knocks about a minute off the run time. Could knock another 30 seconds off by runing the IP lookups in parallel somehow. Maybe.
Diffstat (limited to '')
-rwxr-xr-xapt-panopticon.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index 9786b8b..ff39269 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -515,15 +515,18 @@ local postDownload = function(host, r, k)
515 ' | grep -E "^\\+" | grep -Ev "^\\+\\+\\+|^---" >>results/NEW_Packages_' .. r .. '.txt') 515 ' | grep -E "^\\+" | grep -Ev "^\\+\\+\\+|^---" >>results/NEW_Packages_' .. r .. '.txt')
516 -- Find the smallest new package for each release. 516 -- Find the smallest new package for each release.
517 os.execute('sort -b -k 9,9 -n results/NEW_Packages_' .. r .. '.txt >results/NEW_Packages_' .. r .. '.sorted.txt') 517 os.execute('sort -b -k 9,9 -n results/NEW_Packages_' .. r .. '.txt >results/NEW_Packages_' .. r .. '.sorted.txt')
518 os.execute('grep -s " | pool/DEBIAN/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >results/NEW_Packages_' .. r .. '.test.txt') 518 os.execute('grep -s " | pool/DEBIAN/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >results/NEW_Packages_' .. r .. '.test.tmp')
519 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') 519 os.execute('grep -s " | pool/DEBIAN-SECURITY/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >>results/NEW_Packages_' .. r .. '.test.tmp')
520 os.execute('grep -s " | pool/DEVUAN/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >>results/NEW_Packages_' .. r .. '.test.txt') 520 os.execute('grep -s " | pool/DEVUAN/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >>results/NEW_Packages_' .. r .. '.test.tmp')
521 os.execute('mv results/NEW_Release_' .. n .. '.test.tmp results/NEW_Release_' .. n .. '.test.txt')
521 else 522 else
522 C("Can't find file Packages/" .. r .. dir .. "Packages_parsed-sorted") 523 C("Can't find file Packages/" .. r .. dir .. "Packages_parsed-sorted")
523 end 524 end
524 os.execute('mkdir -p Packages/' .. r .. dir) 525 os.execute('mkdir -p Packages/' .. r .. dir)
525 os.execute('mv -f results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted Packages/' .. r .. dir .. 'Packages_parsed-sorted') 526 os.execute('mv -f results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted Packages/' .. r .. dir .. 'Packages_parsed-sorted')
526 end 527 end
528 else
529 while not APT.checkFile('results/NEW_Release_' .. n .. '.test.txt') do os.execute('sleep 10') end
527 end 530 end
528 os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages 2>/dev/null') 531 os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages 2>/dev/null')
529 os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages.* 2>/dev/null') 532 os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages.* 2>/dev/null')
@@ -687,11 +690,13 @@ if 0 < #arg then
687 if APT.options.referenceSite.value == pu.host then 690 if APT.options.referenceSite.value == pu.host then
688 os.execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' .. 691 os.execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' ..
689 'results/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' .. 692 'results/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' ..
690 '| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >results/NEW_Release_' .. n .. '.txt') 693 '| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >results/NEW_Release_' .. n .. '.tmp')
691-- 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? 694-- 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?
692 os.execute('rm -f results/' .. pu.host .. '/merged/dists/' .. n .. '/Release 2>/dev/null') 695 os.execute('rm -f results/' .. pu.host .. '/merged/dists/' .. n .. '/Release 2>/dev/null; ' ..
696 'mv results/NEW_Release_' .. n .. '.tmp results/NEW_Release_' .. n .. '.txt')
693 else 697 else
694-- TODO - compare to the pkgmaster copy. 698-- TODO - compare to the pkgmaster copy.
699 while not APT.checkFile('results/NEW_Release_' .. n .. '.txt') do os.execute('sleep 10') end
695 end 700 end
696 701
697 local dfile, e = io.open('results/NEW_Release_' .. n .. '.txt', "r") 702 local dfile, e = io.open('results/NEW_Release_' .. n .. '.txt', "r")
@@ -855,9 +860,6 @@ else
855 os.execute("mkdir -p results") 860 os.execute("mkdir -p results")
856 APT.mirrors = getMirrors() 861 APT.mirrors = getMirrors()
857 checkHost(APT.options.referenceSite.value) 862 checkHost(APT.options.referenceSite.value)
858 for i, n in pairs(releases) do
859 while not APT.checkFile('results/NEW_Packages_' .. n .. '.test.txt') do os.execute("sleep 10") end
860 end
861 863
862 for k, m in pairs(APT.mirrors) do 864 for k, m in pairs(APT.mirrors) do
863 if "/" == m.BaseURL:sub(-1, -1) then 865 if "/" == m.BaseURL:sub(-1, -1) then