mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
Fix for compare versions
This commit is contained in:
parent
1481b9d166
commit
da6977fd88
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue