From 923a29b57291e9506f24c15799ea91d95c8441cf Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 3 Jan 2020 01:05:54 +1000 Subject: Fix another race condition. --- apt-panopticon.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 582866b..ac18402 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -843,6 +843,11 @@ local parseRelease = function(host) else -- TODO - compare to the pkgmaster copy. if APT.testing('Updated') then + while not APT.checkFile('results_old/' .. fRp) do + D('*<* About to yield coroutine while waiting on - not APT.checkFile(results_old/' .. fRp .. ')') + coroutine.yield() + D('*>* Resumed coroutine while waiting on - not APT.checkFile(results_old/' .. fRp .. ')') + end 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:' ]] .. fR .. [[.SORTED | cut -d ' ' -f 2-)" '+%s']]):Do().result -- cgit v1.1