From 72658b5b29afaead6b9472b2ef6ca78e2504903a Mon Sep 17 00:00:00 2001 From: dvs1 Date: Sun, 20 Oct 2024 10:53:33 +1000 Subject: chown symlinks, not their destination. --- update_apt-panopticon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update_apt-panopticon b/update_apt-panopticon index dde18a5..969cc8f 100755 --- a/update_apt-panopticon +++ b/update_apt-panopticon @@ -6,12 +6,12 @@ PANOPATH="/var/www/html/apt-panopticon" cd ${PANOPATH}/apt-panopticon_cgp if [ -d .git ] ; then git pull > /dev/null - chown -R www-data:www-data * + chown -hR www-data:www-data * fi cd ${PANOPATH}/apt-panopticon if [ -d .git ] ; then git pull > /dev/null - chown -R www-data:www-data * + chown -hR www-data:www-data * fi # Check if the lock file still exists. @@ -49,7 +49,7 @@ if [ -f apt-panopticon.lock ] ; then fi rm ../results; ln -s apt-panopticon/results ../results -chown -R www-data:www-data * +chown -hR www-data:www-data * # Clean up any mess left over from THIS failed run. find results_* -maxdepth 2 ! -name "pkgmaster.devuan.org" -name "*.*" -type d -print0 | xargs -0rt /bin/rm -fr -- cgit v1.1 From f5e9aceebfc1e9ee4c8383b55d8190e27ad7f7db Mon Sep 17 00:00:00 2001 From: dvs1 Date: Sun, 20 Oct 2024 10:54:11 +1000 Subject: Tweak APT.exe so status works more reliably. --- apt-panopticommon.lua | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index e31c22f..0939c3a 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -501,6 +501,8 @@ APT.readCmd = function(cmd) table.insert(result, l) end end + -- While this does return the same things as os.execute(), it's just as useless. + output:close() return result end @@ -590,23 +592,23 @@ APT.exe = function(c) I'm getting 7168 or 0. No idea what the fuck that is. local ok, rslt, status = os.execute(s) ]] - local f = APT.readCmd(self.cmd, 'r') + local f = APT.readCmd(self.cmd .. '; echo "$?"', 'r') -- The last line will be the command's returned status, collect everything else in result. - self.status = '' -- Otherwise the result starts with 0. + self.status = tonumber(f[#f]) + f[#f] = nil self.result = '\n' for i,l in ipairs(f) do self.result = self.result .. l .. "\n" end - f = APT.readCmd('echo "$?"', 'r') - for i,l in ipairs(f) do - self.status = tonumber(l) - if (137 == self.status) or (124 == self.status) then - print("timeout killed " .. self.status .. ' ' .. self.command) - E("timeout killed " .. self.status .. ' ' .. self.command) - elseif (0 ~= self.status) then - print("status |" .. self.status .. '| ' .. self.command) - E("status |" .. self.status .. '| ' .. self.command) - end + if (137 == self.status) or (124 == self.status) then + print("timeout killed " .. self.status .. ' ' .. self.command) + print('ERROR ' .. "timeout killed " .. self.status .. ' ' .. self.command) + elseif (nil == self.status) then + print("status |" .. "NIL" .. '| ' .. self.command) + E("status |" .. "NIL" .. '| ' .. self.command) + elseif (0 ~= self.status) then +-- print("status |" .. self.status .. '| ' .. self.command) + E("status |" .. self.status .. '| ' .. self.command) end return self end -- cgit v1.1