diff options
Diffstat (limited to '')
-rw-r--r-- | apt-panopticommon.lua | 26 | ||||
-rwxr-xr-x | update_apt-panopticon | 6 |
2 files changed, 17 insertions, 15 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) | |||
501 | table.insert(result, l) | 501 | table.insert(result, l) |
502 | end | 502 | end |
503 | end | 503 | end |
504 | -- While this does return the same things as os.execute(), it's just as useless. | ||
505 | output:close() | ||
504 | return result | 506 | return result |
505 | end | 507 | end |
506 | 508 | ||
@@ -590,23 +592,23 @@ APT.exe = function(c) | |||
590 | I'm getting 7168 or 0. No idea what the fuck that is. | 592 | I'm getting 7168 or 0. No idea what the fuck that is. |
591 | local ok, rslt, status = os.execute(s) | 593 | local ok, rslt, status = os.execute(s) |
592 | ]] | 594 | ]] |
593 | local f = APT.readCmd(self.cmd, 'r') | 595 | local f = APT.readCmd(self.cmd .. '; echo "$?"', 'r') |
594 | -- The last line will be the command's returned status, collect everything else in result. | 596 | -- The last line will be the command's returned status, collect everything else in result. |
595 | self.status = '' -- Otherwise the result starts with 0. | 597 | self.status = tonumber(f[#f]) |
598 | f[#f] = nil | ||
596 | self.result = '\n' | 599 | self.result = '\n' |
597 | for i,l in ipairs(f) do | 600 | for i,l in ipairs(f) do |
598 | self.result = self.result .. l .. "\n" | 601 | self.result = self.result .. l .. "\n" |
599 | end | 602 | end |
600 | f = APT.readCmd('echo "$?"', 'r') | 603 | if (137 == self.status) or (124 == self.status) then |
601 | for i,l in ipairs(f) do | 604 | print("timeout killed " .. self.status .. ' ' .. self.command) |
602 | self.status = tonumber(l) | 605 | print('ERROR ' .. "timeout killed " .. self.status .. ' ' .. self.command) |
603 | if (137 == self.status) or (124 == self.status) then | 606 | elseif (nil == self.status) then |
604 | print("timeout killed " .. self.status .. ' ' .. self.command) | 607 | print("status |" .. "NIL" .. '| ' .. self.command) |
605 | E("timeout killed " .. self.status .. ' ' .. self.command) | 608 | E("status |" .. "NIL" .. '| ' .. self.command) |
606 | elseif (0 ~= self.status) then | 609 | elseif (0 ~= self.status) then |
607 | print("status |" .. self.status .. '| ' .. self.command) | 610 | -- print("status |" .. self.status .. '| ' .. self.command) |
608 | E("status |" .. self.status .. '| ' .. self.command) | 611 | E("status |" .. self.status .. '| ' .. self.command) |
609 | end | ||
610 | end | 612 | end |
611 | return self | 613 | return self |
612 | end | 614 | end |
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" | |||
6 | cd ${PANOPATH}/apt-panopticon_cgp | 6 | cd ${PANOPATH}/apt-panopticon_cgp |
7 | if [ -d .git ] ; then | 7 | if [ -d .git ] ; then |
8 | git pull > /dev/null | 8 | git pull > /dev/null |
9 | chown -R www-data:www-data * | 9 | chown -hR www-data:www-data * |
10 | fi | 10 | fi |
11 | cd ${PANOPATH}/apt-panopticon | 11 | cd ${PANOPATH}/apt-panopticon |
12 | if [ -d .git ] ; then | 12 | if [ -d .git ] ; then |
13 | git pull > /dev/null | 13 | git pull > /dev/null |
14 | chown -R www-data:www-data * | 14 | chown -hR www-data:www-data * |
15 | fi | 15 | fi |
16 | 16 | ||
17 | # Check if the lock file still exists. | 17 | # Check if the lock file still exists. |
@@ -49,7 +49,7 @@ if [ -f apt-panopticon.lock ] ; then | |||
49 | fi | 49 | fi |
50 | rm ../results; ln -s apt-panopticon/results ../results | 50 | rm ../results; ln -s apt-panopticon/results ../results |
51 | 51 | ||
52 | chown -R www-data:www-data * | 52 | chown -hR www-data:www-data * |
53 | 53 | ||
54 | # Clean up any mess left over from THIS failed run. | 54 | # Clean up any mess left over from THIS failed run. |
55 | find results_* -maxdepth 2 ! -name "pkgmaster.devuan.org" -name "*.*" -type d -print0 | xargs -0rt /bin/rm -fr | 55 | find results_* -maxdepth 2 ! -name "pkgmaster.devuan.org" -name "*.*" -type d -print0 | xargs -0rt /bin/rm -fr |