aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2020-01-02 14:25:33 +1000
committeronefang2020-01-02 14:25:33 +1000
commit8cc61ae50d261283553855f27b471bbf123d2a53 (patch)
tree278e7880feed8abce31188d271f68707bb215849
parentMaybe fix the missing speeds. (diff)
downloadapt-panopticon-8cc61ae50d261283553855f27b471bbf123d2a53.zip
apt-panopticon-8cc61ae50d261283553855f27b471bbf123d2a53.tar.gz
apt-panopticon-8cc61ae50d261283553855f27b471bbf123d2a53.tar.bz2
apt-panopticon-8cc61ae50d261283553855f27b471bbf123d2a53.tar.xz
Forgot a couple things in the last commit.
-rwxr-xr-xapt-panopticon.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index 4981ad3..8f953d0 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -955,10 +955,12 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them.
955 local num = '[%d%.]+[kM]?' 955 local num = '[%d%.]+[kM]?'
956 if APT.checkFile(f) then 956 if APT.checkFile(f) then
957 for l in io.lines(f) do 957 for l in io.lines(f) do
958 local speed, crrnt = l:match('^%c *'..num..' +'..num..' +%d+ +%d+[kM]? +%d+ +%d+ +('..num..') +%d+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +('..num..')') 958 local speed, crrnt = l:match('^%c *'..num..' +'..num..' +%d+ +'..num..' +%d+ +%d+ +('..num..') +%d+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +('..num..')')
959 if nil ~= speed then 959 if nil ~= speed then
960 if 'k' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000' end 960 if 'k' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000' end
961 if 'k' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000' end 961 if 'k' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000' end
962 if 'M' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000000' end
963 if 'M' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000000' end
962 speed = tonumber(speed) 964 speed = tonumber(speed)
963 crrnt = tonumber(crrnt) 965 crrnt = tonumber(crrnt)
964 if speed < min and speed ~= 0 then min = speed end 966 if speed < min and speed ~= 0 then min = speed end