From 8e5ac033701c27360112f5fc13f1aa78c1326c11 Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 29 Dec 2019 11:20:44 +1000 Subject: Fix up some time stuff. --- apt-panopticon-update-data.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'apt-panopticon-update-data.lua') diff --git a/apt-panopticon-update-data.lua b/apt-panopticon-update-data.lua index 105a1c7..9d7e1ff 100755 --- a/apt-panopticon-update-data.lua +++ b/apt-panopticon-update-data.lua @@ -50,7 +50,7 @@ local files = io.popen('ls -1 results_*/results_*.tar.xz 2>/dev/null; ls -1 resu for l in files:lines() do local lsub = l:sub(1, -8) - local dt = os.date('!%s', os.time{year = l:sub(-23, -20), month = l:sub(-18, -17), day = l:sub(-15, -14), hour = l:sub(-12, -11), minute = l:sub(-9, -8)}) - (60 * 60) + local dt = os.date('!%s', os.time{year = l:sub(-23, -20), month = l:sub(-18, -17), day = l:sub(-15, -14), hour = l:sub(-12, -11), min = l:sub(-9, -8)}) - (60 * 60) if dt < oldest then oldest = dt; print('\nOldest time is ' .. oldest) end if -1 < APT.verbosity then io.stdout:write('\r' .. 'tar -xf ' .. l); io.stdout:flush() end @@ -106,12 +106,7 @@ local files = io.popen('ls -d1 results_*') for l in files:lines() do if ('results_old' ~= l) and ('.tar.xz' ~= l:sub(25, -1)) then if APT.checkFile(l .. '/stamp') then --- local status, whn = APT.execute('TZ="GMT" ls -d1 --time-style="+%s" ' .. l .. ' | cut -d " " -f 6-6') - local whn = APT.exe('TZ="GMT" ls -d1 --time-style="+%s" ' .. l .. ' | cut -d " " -f 6-6'):Do() - whn = whn:sub(2, -2) --- local status, new = APT.execute('TZ="GMT" date -d "' .. whn:sub(9, 18) .. ' ' .. whn:sub(20, 21) .. ':' .. whn:sub(23, 24) .. '" "+%s"') - local new = APT.exe('TZ="GMT" date -d "' .. whn:sub(9, 18) .. ' ' .. whn:sub(20, 21) .. ':' .. whn:sub(23, 24) .. '" "+%s"'):Do() - APT.now = tonumber("0" .. new:sub(2, -2)) + APT.now = os.date('!%s', os.time{year = l:sub(9, 12), month = l:sub(14, 15), day = l:sub(17, 18), hour = l:sub(20, 21), min = l:sub(23, 24)}) if 0 ~= APT.now then if APT.checkFile(l .. '/mirrors.lua') then if -1 < APT.verbosity then io.stdout:write('\r' .. l .. ' -> ' .. APT.now); io.stdout:flush() end -- cgit v1.1