Fixed summary

This commit is contained in:
Dimitris Zlatanidis 2023-01-04 19:39:00 +02:00
parent 34a49ac076
commit 888da294f2

View file

@ -4,6 +4,7 @@
import os
import shutil
from typing import Any
from distutils.version import LooseVersion
from slpkg.configs import Configs
from slpkg.views.ascii import Ascii
@ -214,10 +215,19 @@ class ViewMessage:
install = upgrade = remove = build = 0
for sbo in slackbuilds:
if not self.utils.is_installed(sbo):
inst_ver = repo_ver = 0
installed = self.utils.is_installed(sbo)
if installed:
inst_ver = self.utils.split_installed_pkg(installed)[1]
repo_ver = SBoQueries(sbo).version()
if not installed:
install += 1
elif self.utils.is_installed(sbo) or self.utils.is_installed(sbo) and '--reinstall' in self.flags:
elif installed and '--reinstall' in self.flags:
upgrade += 1
elif installed and LooseVersion(repo_ver) > LooseVersion(inst_ver) and '--reinstall' not in self.flags:
upgrade += 1
elif installed and option == 'remove':
remove += 1
else:
build += 1