mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Updated for choose for upgrade
This commit is contained in:
parent
88e118f08f
commit
e81ec798ee
1 changed files with 18 additions and 12 deletions
|
@ -62,20 +62,26 @@ class Choose(Configs):
|
|||
|
||||
def choose_for_upgraded(self, data: dict, packages: list):
|
||||
""" Choose packages that they will going to upgrade. """
|
||||
for pkg in packages:
|
||||
for package in data.keys():
|
||||
for package in packages:
|
||||
# for package in data.keys():
|
||||
|
||||
if pkg == package:
|
||||
inst_package: str = self.utils.is_package_installed(package)
|
||||
inst_package_version: str = self.utils.split_package(inst_package)['version']
|
||||
inst_package_build: str = self.utils.split_package(inst_package)['build']
|
||||
repo_ver: str = data[package]['version']
|
||||
repo_build_tag: str = data[package]['build']
|
||||
if package in data.keys():
|
||||
inst_package: str = self.utils.is_package_installed(package)
|
||||
inst_package_version: str = self.utils.split_package(inst_package)['version']
|
||||
inst_package_build: str = self.utils.split_package(inst_package)['build']
|
||||
|
||||
self.choices.extend(
|
||||
[(package, f'{inst_package_version} -> {repo_ver}', True,
|
||||
f'Installed: {package}-{inst_package_version} Build: {inst_package_build} -> '
|
||||
f'Available: {repo_ver} Build: {repo_build_tag}')])
|
||||
if not inst_package_version:
|
||||
inst_package_version: str = 'None'
|
||||
if not inst_package_build:
|
||||
inst_package_build: str = 'None'
|
||||
|
||||
repo_ver: str = data[package]['version']
|
||||
repo_build_tag: str = data[package]['build']
|
||||
|
||||
self.choices.extend(
|
||||
[(package, f'{inst_package_version} -> {repo_ver}', True,
|
||||
f'Installed: {package}-{inst_package_version} Build: {inst_package_build} -> '
|
||||
f'Available: {repo_ver} Build: {repo_build_tag}')])
|
||||
|
||||
def choose_for_others(self, data: dict, packages: list):
|
||||
""" Choose packages for others methods like install, tracking etc. """
|
||||
|
|
Loading…
Add table
Reference in a new issue