Updated summary

This commit is contained in:
Dimitris Zlatanidis 2023-01-04 17:05:17 +02:00
parent fbd4d8f290
commit 5eca8a635e

View file

@ -212,15 +212,16 @@ class ViewMessage:
def summary(self, slackbuilds: list, dependencies: list, option: str): def summary(self, slackbuilds: list, dependencies: list, option: str):
""" View the status of the packages action. """ """ View the status of the packages action. """
slackbuilds.extend(dependencies) slackbuilds.extend(dependencies)
install = upgrade = remove = 0 install = upgrade = remove = build = 0
for sbo in slackbuilds: for sbo in slackbuilds:
if not self.utils.is_installed(sbo): if not self.utils.is_installed(sbo):
install += 1 install += 1
elif self.utils.is_installed(sbo) and '--reinstall' in self.flags: elif self.utils.is_installed(sbo) or self.utils.is_installed(sbo) and '--reinstall' in self.flags:
upgrade += 1 upgrade += 1
elif self.utils.is_installed(sbo) and option == 'remove':
remove += 1 remove += 1
else:
build += 1
self.draw_bottom_line() self.draw_bottom_line()
@ -229,7 +230,7 @@ class ViewMessage:
f'installed and {upgrade} will be upgraded.{self.endc}') f'installed and {upgrade} will be upgraded.{self.endc}')
elif option == 'build': elif option == 'build':
print(f'{self.grey}Total {install + upgrade} packages ' print(f'{self.grey}Total {build} packages '
f'will be build.{self.endc}') f'will be build.{self.endc}')
elif option == 'remove': elif option == 'remove':