From 14881493390cb2b41ea2b04c4be478dfd373f2d3 Mon Sep 17 00:00:00 2001
From: onefang
Date: Wed, 25 Dec 2019 23:11:53 +1000
Subject: Don't log some APT.execute() calls.
---
apt-panopticommon.lua | 5 +++--
apt-panopticon.lua | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua
index 55f0e40..1405622 100644
--- a/apt-panopticommon.lua
+++ b/apt-panopticommon.lua
@@ -425,8 +425,9 @@ APT.testing = function(t, host)
return false
end
-APT.execute = function (s)
- D(" executing - " .. s .. "
")
+APT.execute = function (s, logit)
+ if nil == logit then logit = true end
+ if logit then D(" executing - " .. s .. "
") end
--[[ Damn os.execute()
Lua 5.1 says it returns "a status code, which is system-dependent"
Lua 5.2 says it returns true/nil, "exit"/"signal", the status code.
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index 72ac6ae..5493683 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -486,8 +486,8 @@ local postDownload = function(host, r, k)
" results/" .. host .. "/merged/dists/" .. r .. '/' .. k .. ".old" ..
" results/" .. host .. "/merged/dists/" .. r .. '/' .. k .. "; fi")
if APT.checkFile('results/' .. host .. '/merged/dists/' .. r .. '/' .. k) then
- if ".gz" == k:sub(-3, -1) then APT.execute("ionice -c3 nice -n 19 gzip -dfk results/" .. host .. "/merged/dists/" .. r .. '/' .. k) end
- if ".xz" == k:sub(-3, -1) then APT.execute("ionice -c3 nice -n 19 xz -dfk results/" .. host .. "/merged/dists/" .. r .. '/' .. k .. " 2>/dev/null") end
+ if ".gz" == k:sub(-3, -1) then APT.execute("ionice -c3 nice -n 19 gzip -dfk results/" .. host .. "/merged/dists/" .. r .. '/' .. k, false) end
+ if ".xz" == k:sub(-3, -1) then APT.execute("ionice -c3 nice -n 19 xz -dfk results/" .. host .. "/merged/dists/" .. r .. '/' .. k .. " 2>/dev/null", false) end
end
end
@@ -632,7 +632,7 @@ local parseDebs = function(host)
local v, p, sz, sha = l:match(' | (.+) | (pool/.+%.deb) | (%d.+) | (%x.+) |')
if nil ~= p then
if APT.checkFile('results/' .. host .. "/merged/" .. p) then
- local status, fsz = APT.execute('ls -l results/' .. host .. "/merged/" .. p .. ' | cut -d " " -f 5-5')
+ local status, fsz = APT.execute('ls -l results/' .. host .. "/merged/" .. p .. ' | cut -d " " -f 5-5', false)
if APT.testing("Integrity") then
if sz ~= fsz:sub(2, -2) then -- The sub bit is to slice off the EOLs at each end.
E('Package size mismatch - results/' .. host .. "/merged/" .. p .. ' should be ' .. sz .. ', but is ' .. fsz:sub(2, -2) .. '.', 'http', 'Integrity', host)
--
cgit v1.1