diff --git a/slpkg/utilities.py b/slpkg/utilities.py index 60295627..ec409286 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -33,14 +33,14 @@ class Utilities: self.bred: str = f'{self.bold}{self.red}' self.installed_packages: list = list(self.all_installed()) + self.installed_package_names: list = list(self.all_installed_names()) def is_package_installed(self, name: str) -> str: """ Returns the installed package name. """ - for package in self.installed_packages: - pkg: str = self.split_binary_pkg(package)[0] + for package_name in self.installed_package_names: - if pkg == name: - return package + if package_name == name: + return package_name return '' @@ -127,8 +127,8 @@ class Utilities: if installed: installed_version: str = self.split_binary_pkg(installed)[1] - return (str(LooseVersion(repository_version + repo_build_tag)) > - str(LooseVersion(installed_version + inst_build_tag))) + return (str(LooseVersion(f'{repository_version}.{repo_build_tag}')) > + str(LooseVersion(f'{repository_version}.{repo_build_tag}'))) def read_build_tag(self, sbo: str) -> str: """ Patching SBo TAG from the configuration file. """