diff --git a/ChangeLog.txt b/ChangeLog.txt index 5b3969e6..79942537 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,10 @@ ## slpkg - ChangeLog +### 5.0.9 - 11/05/2024 + +- Bugfixes: + * Fixes the compare version with the upgrade command + ### 5.0.8 - 10/05/2024 - Added: diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index 47794bd0..7d255ac5 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -123,18 +123,19 @@ class Upgrade(Configs): # pylint: disable=[R0902] if parse(repo_version) == parse(inst_version) and int(repo_build) > int(inst_build): return True except InvalidVersion as err: - # Different options to compare packages. - repo_package: str = self.data[inst_name]['package'] - if repo_version > inst_version: # Try to compare the strings. - return True - if repo_version == inst_version and int(repo_build) > int(inst_build): - return True - if installed != repo_package[:-4]: # Add the package if a new one on the repository. - return True - if installed == repo_package[:-4]: # Not new packages in the repository. - return False self._write_log_file(installed, inst_name, err) + # Different options to compare packages. + repo_package: str = self.data[inst_name]['package'] + if repo_version > inst_version: # Try to compare the strings. + return True + if repo_version == inst_version and int(repo_build) > int(inst_build): + return True + if installed != repo_package[:-4]: # Add the package if a new one on the repository. + return True + if installed == repo_package[:-4]: # Not new packages in the repository. + return False + return False def _write_log_file(self, installed: str, name: str, err: InvalidVersion) -> None: