From dbf52bde43dbebfb12e39895d7d9fd3bd25ab7b4 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 5 Dec 2019 03:29:18 +1000 Subject: Store any previously parsed Packages, so we always have one to use. --- .gitignore | 1 + apt-panopticon.lua | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4dd18d3..9a111ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ results/ results_*/ +Packages/ diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 3afe3a1..cf95a8e 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -713,11 +713,11 @@ local postDownload = function(host, r, k) end Pp:close() os.execute('sort results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed >results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages_parsed-sorted') - if checkFile('results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted') then - os.execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted ' .. + if checkFile('Packages/' .. r .. dir .. 'Packages_parsed-sorted') then + os.execute('diff -U 0 Packages/' .. r .. dir .. 'Packages_parsed-sorted ' .. 'results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted ' .. ' | grep -E "^-" | grep -Ev "^\\+\\+\\+|^---" >>results/OLD_PACKAGES_' .. r .. '.txt') - os.execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted ' .. + os.execute('diff -U 0 Packages/' .. r .. dir .. 'Packages_parsed-sorted ' .. 'results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted ' .. ' | grep -E "^\\+" | grep -Ev "^\\+\\+\\+|^---" >>results/NEW_Packages_' .. r .. '.txt') -- Find the smallest new package for each release. @@ -726,8 +726,10 @@ local postDownload = function(host, r, k) 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') os.execute('grep -s " | pool/DEVUAN/" results/NEW_Packages_' .. r .. '.sorted.txt 2>/dev/null | head -n 1 >>results/NEW_Packages_' .. r .. '.test.txt') else - C("Can't find file results_old/pkgmaster.devuan.org/merged/dists/" .. r .. dir .. "Packages_parsed-sorted") + C("Can't find file Packages/" .. r .. dir .. "Packages_parsed-sorted") end + os.execute('mkdir -p Packages/' .. r .. dir) + os.execute('mv -f results/pkgmaster.devuan.org/merged/dists/' .. r .. dir .. 'Packages_parsed-sorted Packages/' .. r .. dir .. 'Packages_parsed-sorted') end end os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages 2>/dev/null') -- cgit v1.1