mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-19 10:27:07 +01:00
Fixed for none version
This commit is contained in:
parent
17ee1e3181
commit
df87c04ac5
1 changed files with 8 additions and 2 deletions
|
@ -7,6 +7,7 @@ import tarfile
|
|||
from pathlib import Path
|
||||
from typing import Generator, Any
|
||||
from distutils.version import LooseVersion
|
||||
# from packaging.version import Version
|
||||
|
||||
from slpkg.configs import Configs
|
||||
from slpkg.queries import SBoQueries
|
||||
|
@ -94,10 +95,15 @@ class Utilities:
|
|||
|
||||
def is_package_upgradeable(self, package: str, file_pattern: str) -> Any:
|
||||
""" Checks if the package is installed and if it is upgradeable, returns true. """
|
||||
installed_version: str = '0'
|
||||
installed = self.is_package_installed(package, file_pattern)
|
||||
repository_version = SBoQueries(package).version()
|
||||
|
||||
if not repository_version:
|
||||
repository_version: str = '0'
|
||||
|
||||
if installed:
|
||||
installed_version = self.split_installed_pkg(installed)[1]
|
||||
repository_version = SBoQueries(package).version()
|
||||
|
||||
return LooseVersion(repository_version) > LooseVersion(installed_version)
|
||||
|
||||
|
|
Loading…
Reference in a new issue