mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-31 10:26:39 +01:00
Switched to packaging
This commit is contained in:
parent
75b032e35d
commit
ecbebd2622
1 changed files with 3 additions and 6 deletions
|
@ -7,8 +7,7 @@ import shutil
|
|||
import subprocess
|
||||
from pathlib import Path
|
||||
from typing import Generator, Any, Union
|
||||
from distutils.version import LooseVersion
|
||||
# from packaging.version import Version
|
||||
from packaging.version import parse
|
||||
|
||||
from slpkg.configs import Configs
|
||||
from slpkg.sbos.queries import SBoQueries
|
||||
|
@ -38,9 +37,8 @@ class Utilities:
|
|||
def is_package_installed(self, name: str) -> str:
|
||||
""" Returns the installed package name. """
|
||||
for package_name in self.installed_package_names:
|
||||
|
||||
if package_name == name:
|
||||
return package_name
|
||||
return name
|
||||
|
||||
return ''
|
||||
|
||||
|
@ -127,8 +125,7 @@ class Utilities:
|
|||
if installed:
|
||||
installed_version: str = self.split_binary_pkg(installed)[1]
|
||||
|
||||
return (str(LooseVersion(f'{repository_version}.{repo_build_tag}')) >
|
||||
str(LooseVersion(f'{installed_version}.{inst_build_tag}')))
|
||||
return parse(repository_version + repo_build_tag) > parse(installed_version + inst_build_tag)
|
||||
|
||||
def read_build_tag(self, sbo: str) -> str:
|
||||
""" Patching SBo TAG from the configuration file. """
|
||||
|
|
Loading…
Reference in a new issue