From d2c122036409c8a20375710e6ff84db65230ea5d Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 11 May 2024 17:06:41 +0300 Subject: [PATCH] Updated for compare versions Signed-off-by: Dimitris Zlatanidis --- slpkg/upgrade.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index 7d255ac5..b31d6c9c 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -124,17 +124,16 @@ class Upgrade(Configs): # pylint: disable=[R0902] return True except InvalidVersion as err: 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 + # 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