mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-25 09:58:41 +01:00
Updated for compare versions
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
c2cdf84c43
commit
d2c1220364
1 changed files with 10 additions and 11 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue