mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
Fixed for empty list
This commit is contained in:
parent
03dfbfedc8
commit
f42e57f9a6
1 changed files with 16 additions and 15 deletions
|
@ -57,21 +57,22 @@ class Upgrade:
|
|||
def packages(self):
|
||||
""" Choose packages for upgrade. """
|
||||
choices = []
|
||||
packages = self.search()
|
||||
packages = list(self.search())
|
||||
|
||||
for package in packages:
|
||||
pkg = self.utils.is_installed(package)
|
||||
inst_ver = self.utils.split_installed_pkg(pkg)[1]
|
||||
repo_ver = SBoQueries(package).version()
|
||||
choices += [(package, f'{inst_ver} -> {repo_ver}', True)]
|
||||
if packages:
|
||||
for package in packages:
|
||||
pkg = self.utils.is_installed(package)
|
||||
inst_ver = self.utils.split_installed_pkg(pkg)[1]
|
||||
repo_ver = SBoQueries(package).version()
|
||||
choices += [(package, f'{inst_ver} -> {repo_ver}', True)]
|
||||
|
||||
code, tags = self.d.checklist(f'There are {len(choices)} packages for upgrade:',
|
||||
title='Choose packages you want to upgrade',
|
||||
height=10, width=70, list_height=0, choices=choices)
|
||||
os.system('clear')
|
||||
if code == self.d.OK:
|
||||
if not tags:
|
||||
raise SystemExit()
|
||||
return tags
|
||||
code, tags = self.d.checklist(f'There are {len(choices)} packages for upgrade:',
|
||||
title='Choose packages you want to upgrade',
|
||||
height=10, width=70, list_height=0, choices=choices)
|
||||
os.system('clear')
|
||||
if code == self.d.OK:
|
||||
if not tags:
|
||||
raise SystemExit()
|
||||
return tags
|
||||
|
||||
raise SystemExit()
|
||||
raise SystemExit()
|
||||
|
|
Loading…
Reference in a new issue