mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Updated for self method
This commit is contained in:
parent
7d156e7a2a
commit
2f2aad3c5c
1 changed files with 4 additions and 6 deletions
|
@ -25,16 +25,14 @@ class Utilities:
|
|||
|
||||
def is_installed(self, name: str) -> str:
|
||||
""" Returns the installed package name. """
|
||||
pattern = f'*{self.configs.sbo_repo_tag}'
|
||||
installed = self.all_installed()
|
||||
|
||||
var_log_packages = Path(self.configs.log_packages)
|
||||
packages = [file.name for file in var_log_packages.glob(pattern)]
|
||||
|
||||
for package in packages:
|
||||
for package in installed:
|
||||
pkg = self.split_installed_pkg(package)[0]
|
||||
|
||||
if pkg == name and pkg not in self.black.get():
|
||||
if pkg == name:
|
||||
return package
|
||||
|
||||
return ''
|
||||
|
||||
def all_installed(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue