mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-15 03:41:16 +01:00
Moved to main
This commit is contained in:
parent
ccd9aa8af9
commit
51a9abbbf5
2 changed files with 13 additions and 34 deletions
|
@ -84,6 +84,13 @@ class Argparse:
|
||||||
for package in repo_packages:
|
for package in repo_packages:
|
||||||
for pkg in packages:
|
for pkg in packages:
|
||||||
if pkg in package:
|
if pkg in package:
|
||||||
|
|
||||||
|
if method == 'upgrade':
|
||||||
|
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)]
|
||||||
|
else:
|
||||||
repo_ver = SBoQueries(package).version()
|
repo_ver = SBoQueries(package).version()
|
||||||
choices += [(package, repo_ver, False)]
|
choices += [(package, repo_ver, False)]
|
||||||
|
|
||||||
|
@ -134,7 +141,9 @@ class Argparse:
|
||||||
self.check.database()
|
self.check.database()
|
||||||
|
|
||||||
upgrade = Upgrade()
|
upgrade = Upgrade()
|
||||||
packages = upgrade.packages()
|
packages = list(upgrade.packages())
|
||||||
|
|
||||||
|
packages = self.choose_packages(packages, Argparse.upgrade.__name__)
|
||||||
|
|
||||||
if not packages:
|
if not packages:
|
||||||
print('\nEverything is up-to-date.\n')
|
print('\nEverything is up-to-date.\n')
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Upgrade:
|
||||||
self.utils = Utilities()
|
self.utils = Utilities()
|
||||||
self.dialog = DialogBox()
|
self.dialog = DialogBox()
|
||||||
|
|
||||||
def search(self):
|
def packages(self):
|
||||||
""" Compares version of packages and returns the maximum. """
|
""" Compares version of packages and returns the maximum. """
|
||||||
repo_packages = SBoQueries('').sbos()
|
repo_packages = SBoQueries('').sbos()
|
||||||
black = Blacklist().get()
|
black = Blacklist().get()
|
||||||
|
@ -45,33 +45,3 @@ class Upgrade:
|
||||||
for pkg in upgrade:
|
for pkg in upgrade:
|
||||||
if pkg not in requires:
|
if pkg not in requires:
|
||||||
yield pkg
|
yield pkg
|
||||||
|
|
||||||
def packages(self):
|
|
||||||
""" Choose packages for upgrade. """
|
|
||||||
height = 10
|
|
||||||
width = 70
|
|
||||||
list_height = 0
|
|
||||||
choices = []
|
|
||||||
title = ' Choose packages you want to upgrade '
|
|
||||||
packages = list(self.search())
|
|
||||||
|
|
||||||
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)]
|
|
||||||
|
|
||||||
text = f'There are {len(choices)} packages for upgrade:'
|
|
||||||
|
|
||||||
code, tags = self.dialog.checklist(text, title, height, width, list_height, choices, packages)
|
|
||||||
|
|
||||||
if not code:
|
|
||||||
return packages
|
|
||||||
|
|
||||||
os.system('clear')
|
|
||||||
|
|
||||||
if not tags:
|
|
||||||
raise SystemExit()
|
|
||||||
|
|
||||||
return tags
|
|
||||||
|
|
Loading…
Reference in a new issue