luci-base: filter invalid opkg status lines
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
parent
b5826f1ffb
commit
6b3f804956
1 changed files with 6 additions and 5 deletions
|
@ -139,11 +139,13 @@ local function _list(action, pat, cb)
|
||||||
desc = ""
|
desc = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if name and version then
|
||||||
if #version > 26 then
|
if #version > 26 then
|
||||||
version = version:sub(1,21) .. ".." .. version:sub(-3,-1)
|
version = version:sub(1,21) .. ".." .. version:sub(-3,-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
cb(name, version, sz, desc)
|
cb(name, version, sz, desc)
|
||||||
|
end
|
||||||
|
|
||||||
name = nil
|
name = nil
|
||||||
version = nil
|
version = nil
|
||||||
|
@ -238,4 +240,3 @@ function compare_versions(ver1, comp, ver2)
|
||||||
-- all equal and not compare greater or lower then true
|
-- all equal and not compare greater or lower then true
|
||||||
return not (comp == "<" or comp == ">")
|
return not (comp == "<" or comp == ">")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue