mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-28 19:58:18 +01:00
Updated method
This commit is contained in:
parent
47d29ae1e3
commit
acce9e6e0d
2 changed files with 4 additions and 9 deletions
|
@ -60,24 +60,19 @@ class Check(Configs):
|
||||||
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: Package "
|
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: Package "
|
||||||
f"'{self.cyan}{sbo}{self.endc}' unsupported by arch.\n")
|
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. """
|
""" Checking for installed packages. """
|
||||||
found, not_found = [], []
|
not_found = []
|
||||||
|
|
||||||
for sbo in slackbuilds:
|
for sbo in slackbuilds:
|
||||||
package: str = self.utils.is_package_installed(sbo, file_pattern)
|
package: str = self.utils.is_package_installed(sbo, file_pattern)
|
||||||
if package:
|
if not package:
|
||||||
pkg_name: str = self.utils.split_installed_pkg(package)[0]
|
|
||||||
found.append(pkg_name)
|
|
||||||
else:
|
|
||||||
not_found.append(sbo)
|
not_found.append(sbo)
|
||||||
|
|
||||||
if not_found:
|
if not_found:
|
||||||
raise SystemExit(f'\n[{self.bred}Error{self.endc}]: Not found \'{", ".join(not_found)}\' '
|
raise SystemExit(f'\n[{self.bred}Error{self.endc}]: Not found \'{", ".join(not_found)}\' '
|
||||||
'installed packages.\n')
|
'installed packages.\n')
|
||||||
|
|
||||||
return found
|
|
||||||
|
|
||||||
def is_blacklist(self, slackbuilds: list) -> None:
|
def is_blacklist(self, slackbuilds: list) -> None:
|
||||||
""" Checking if the packages are blacklisted. """
|
""" Checking if the packages are blacklisted. """
|
||||||
packages: list = []
|
packages: list = []
|
||||||
|
|
|
@ -546,7 +546,7 @@ class Argparse(Configs):
|
||||||
packages: list = self.choose_packages(packages, command)
|
packages: list = self.choose_packages(packages, command)
|
||||||
|
|
||||||
self.check.is_empty_database()
|
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 = RemovePackages(packages, self.flags, self.file_pattern)
|
||||||
remove.remove()
|
remove.remove()
|
||||||
|
|
Loading…
Add table
Reference in a new issue