diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index 509a942d..bd0691f4 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -63,6 +63,15 @@ class Upgrade(Configs): if name not in self.installed_names: yield name + # def is_package_upgradeable(self, installed: str) -> bool: + # """ Returns True for upgradeable packages. """ + # name: str = self.utils.split_package(installed)['name'] + # if self.data.get(name): + # repo_package: str = self.data[name]['package'] + # + # if installed != repo_package[:-4]: + # return True + def is_package_upgradeable(self, installed: str) -> bool: """ Returns True for upgradeable packages. """ inst_name: str = self.utils.split_package(installed)['name'] @@ -78,7 +87,8 @@ class Upgrade(Configs): if parse(repo_version) == parse(inst_version) and int(repo_build) > int(inst_build): return True except InvalidVersion as err: - if repo_version.replace('_', '-') > inst_version.replace('_', '-'): + repo_package: str = self.data[inst_name]['package'] + if installed != repo_package[:-4]: return True self._write_log_file(installed, inst_name, err) return False