diff --git a/slpkg/utilities.py b/slpkg/utilities.py index b2412631..803e1072 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -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):