[pkg] Fallback the number of lines before packages listing to 0

This commit is contained in:
Elmeri Niemelä 2020-05-23 17:32:34 +03:00 committed by GitHub
parent 3bd7b59b2c
commit bfc0922f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -3,6 +3,8 @@
Fixed:
- [mdir] Remove trailing semicolon at the end of command
- [pkg] Fix widget on Arch, Arch C, FreeBSD and Mandriva:
attempt to perform aithmetic on nil value (field 'sub')
# Changes in 2.4.0

View File

@ -4,6 +4,7 @@
-- Copyright (C) 2017 getzze <getzze@gmail.com>
-- Copyright (C) 2017 mutlusun <mutlusun@github.com>
-- Copyright (C) 2019 Nguyễn Gia Phong <vn.mcsinyx@gmail.com>
-- Copyright (C) 2020 Elmeri Niemelä <niemela.elmeri@gmail.com>
--
-- This file is part of Vicious.
--
@ -30,14 +31,14 @@ local helpers = require("vicious.helpers")
local pkg_all = {}
local PKGMGR = {
["Arch"] = { cmd = "pacman -Qu" },
["Arch C"] = { cmd = "checkupdates" },
["Arch"] = { cmd = "pacman -Qu", sub = 0 },
["Arch C"] = { cmd = "checkupdates", sub = 0 },
["Arch S"] = { cmd = "yes | pacman -Sup", sub = 1 },
["Debian"] = { cmd = "apt list --upgradable", sub = 1 },
["Ubuntu"] = { cmd = "apt list --upgradable", sub = 1 },
["Fedora"] = { cmd = "dnf check-update", sub = 2 },
["FreeBSD"] = { cmd = "pkg version -I -l '<'" },
["Mandriva"] = { cmd = "urpmq --auto-select" }
["FreeBSD"] = { cmd = "pkg version -I -l '<'", sub = 0 },
["Mandriva"] = { cmd = "urpmq --auto-select", sub = 0 }
}
-- {{{ Packages widget type