Updated method

This commit is contained in:
Dimitris Zlatanidis 2023-03-15 19:24:47 +02:00
parent 47d29ae1e3
commit acce9e6e0d
2 changed files with 4 additions and 9 deletions

View file

@ -60,24 +60,19 @@ class Check(Configs):
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: Package "
f"'{self.cyan}{sbo}{self.endc}' unsupported by arch.\n")
def is_installed(self, slackbuilds: list, file_pattern: str) -> list:
def is_installed(self, slackbuilds: list, file_pattern: str) -> None:
""" Checking for installed packages. """
found, not_found = [], []
not_found = []
for sbo in slackbuilds:
package: str = self.utils.is_package_installed(sbo, file_pattern)
if package:
pkg_name: str = self.utils.split_installed_pkg(package)[0]
found.append(pkg_name)
else:
if not package:
not_found.append(sbo)
if not_found:
raise SystemExit(f'\n[{self.bred}Error{self.endc}]: Not found \'{", ".join(not_found)}\' '
'installed packages.\n')
return found
def is_blacklist(self, slackbuilds: list) -> None:
""" Checking if the packages are blacklisted. """
packages: list = []

View file

@ -546,7 +546,7 @@ class Argparse(Configs):
packages: list = self.choose_packages(packages, command)
self.check.is_empty_database()
packages: list = self.check.is_installed(packages, self.file_pattern)
self.check.is_installed(packages, self.file_pattern)
remove = RemovePackages(packages, self.flags, self.file_pattern)
remove.remove()