From bfc0922f6eb9c859926d8c2c0b57aba67e92ca2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elmeri=20Niemel=C3=A4?= <36383311+elmeriniemela@users.noreply.github.com> Date: Sat, 23 May 2020 17:32:34 +0300 Subject: [PATCH] [pkg] Fallback the number of lines before packages listing to 0 --- Changes.md | 2 ++ widgets/pkg_all.lua | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Changes.md b/Changes.md index 59ba1e0..d929c18 100644 --- a/Changes.md +++ b/Changes.md @@ -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 diff --git a/widgets/pkg_all.lua b/widgets/pkg_all.lua index ca77e91..609aaf8 100644 --- a/widgets/pkg_all.lua +++ b/widgets/pkg_all.lua @@ -4,6 +4,7 @@ -- Copyright (C) 2017 getzze -- Copyright (C) 2017 mutlusun -- Copyright (C) 2019 Nguyễn Gia Phong +-- Copyright (C) 2020 Elmeri Niemelä -- -- 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