Merge pull request #865 from ishaanbhimwal/aur-update

Fix aur-update showing wrong update number
This commit is contained in:
tobi-wan-kenobi 2022-03-14 21:20:53 +01:00 committed by GitHub
commit 69edfc42ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,16 +1,7 @@
"""Check updates for AUR. """Check updates for AUR.
Requires the following packages: Requires the following packages:
* yay (used as default) * yay (https://github.com/Jguer/yay)
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
contributed by `ishaanbhimwal <https://github.com/ishaanbhimwal>`_ - many thanks! contributed by `ishaanbhimwal <https://github.com/ishaanbhimwal>`_ - many thanks!
""" """
@ -49,12 +40,13 @@ class Module(core.module.Module):
) )
if code == 0: if code == 0:
self.__packages = len(result.strip().split("\n")) if result == "":
elif code == 2: self.__packages = 0
self.__packages = 0 else:
self.__packages = len(result.strip().split("\n"))
else: else:
self.__error = True 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): def state(self, widget):
if self.__error: if self.__error: