From f513582d44d33cc32e71dfb16a8968ca055216db Mon Sep 17 00:00:00 2001 From: ishaan Date: Tue, 15 Mar 2022 01:17:57 +0530 Subject: [PATCH] fix aur-update showing wrong update number --- .../modules/contrib/aur-update.py | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/bumblebee_status/modules/contrib/aur-update.py b/bumblebee_status/modules/contrib/aur-update.py index c175a63..14bee6b 100644 --- a/bumblebee_status/modules/contrib/aur-update.py +++ b/bumblebee_status/modules/contrib/aur-update.py @@ -1,16 +1,7 @@ """Check updates for AUR. Requires the following packages: - * yay (used as default) - -Note - You can replace yay by changing the "yay -Qum" -command for your preferred AUR helper. Few examples: - -paru -Qum -pikaur -Qua -rua upgrade --printonly -trizen -Su --aur --quiet -yay -Qum + * yay (https://github.com/Jguer/yay) contributed by `ishaanbhimwal `_ - many thanks! """ @@ -49,12 +40,13 @@ class Module(core.module.Module): ) if code == 0: - self.__packages = len(result.strip().split("\n")) - elif code == 2: - self.__packages = 0 + if result == "": + self.__packages = 0 + else: + self.__packages = len(result.strip().split("\n")) else: self.__error = True - logging.error("yay -Qum exited with {}: {}".format(code, result)) + logging.error("aur-update exited with {}: {}".format(code, result)) def state(self, widget): if self.__error: