mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-28 09:58:21 +01:00
Fixed removed packages
This commit is contained in:
parent
302220e698
commit
f93aa83ced
1 changed files with 8 additions and 9 deletions
|
@ -35,6 +35,7 @@ class ViewMessage:
|
||||||
self.bcyan = f'{self.bold}{self.cyan}'
|
self.bcyan = f'{self.bold}{self.cyan}'
|
||||||
self.red = self.color['red']
|
self.red = self.color['red']
|
||||||
self.grey = self.color['grey']
|
self.grey = self.color['grey']
|
||||||
|
self.violet = self.color['violet']
|
||||||
self.endc = self.color['endc']
|
self.endc = self.color['endc']
|
||||||
self.installed_packages = []
|
self.installed_packages = []
|
||||||
self.columns, self.rows = shutil.get_terminal_size()
|
self.columns, self.rows = shutil.get_terminal_size()
|
||||||
|
@ -77,7 +78,7 @@ class ViewMessage:
|
||||||
if mode == 'build':
|
if mode == 'build':
|
||||||
color = self.yellow
|
color = self.yellow
|
||||||
if mode == 'upgrade':
|
if mode == 'upgrade':
|
||||||
color = self.green
|
color = self.violet
|
||||||
|
|
||||||
print(f'{self.bgreen}{self.vl} {self.bold}{color}{package}{self.endc}' + ' ' * (35 - len(package)) +
|
print(f'{self.bgreen}{self.vl} {self.bold}{color}{package}{self.endc}' + ' ' * (35 - len(package)) +
|
||||||
f'{version}' + ' ' * ((self.columns - 37) - len(version) - 1) + f'{self.bgreen}{self.vl}{self.endc}')
|
f'{version}' + ' ' * ((self.columns - 37) - len(version) - 1) + f'{self.bgreen}{self.vl}{self.endc}')
|
||||||
|
@ -141,7 +142,7 @@ class ViewMessage:
|
||||||
|
|
||||||
def remove_packages(self, packages: list) -> Any:
|
def remove_packages(self, packages: list) -> Any:
|
||||||
""" View remove packages. """
|
""" View remove packages. """
|
||||||
slackbuilds, dependencies, deps = [], [], []
|
slackbuilds, dependencies = [], []
|
||||||
for pkg in packages:
|
for pkg in packages:
|
||||||
slackbuilds.append(pkg)
|
slackbuilds.append(pkg)
|
||||||
|
|
||||||
|
@ -150,13 +151,9 @@ class ViewMessage:
|
||||||
LogsDependencies.name == pkg).first()
|
LogsDependencies.name == pkg).first()
|
||||||
|
|
||||||
if requires:
|
if requires:
|
||||||
deps.append(requires)
|
dependencies += requires[0].split()
|
||||||
|
|
||||||
for i in range(0, len(deps)):
|
if dependencies and '--resolve-off' not in self.flags:
|
||||||
for dep in deps[i][0].split():
|
|
||||||
dependencies.append(dep)
|
|
||||||
|
|
||||||
if deps and '--resolve-off' not in self.flags:
|
|
||||||
dependencies = self.choose_dependencies_for_remove(dependencies)
|
dependencies = self.choose_dependencies_for_remove(dependencies)
|
||||||
|
|
||||||
self.draw_title_box('The following packages will be removed:', 'Remove Packages')
|
self.draw_title_box('The following packages will be removed:', 'Remove Packages')
|
||||||
|
@ -164,12 +161,14 @@ class ViewMessage:
|
||||||
for pkg in slackbuilds:
|
for pkg in slackbuilds:
|
||||||
self._view_removed(pkg)
|
self._view_removed(pkg)
|
||||||
|
|
||||||
if deps and '--resolve-off' not in self.flags:
|
if dependencies and '--resolve-off' not in self.flags:
|
||||||
self.draw_middle_line()
|
self.draw_middle_line()
|
||||||
self.draw_dependency_line()
|
self.draw_dependency_line()
|
||||||
|
|
||||||
for pkg in dependencies:
|
for pkg in dependencies:
|
||||||
self._view_removed(pkg)
|
self._view_removed(pkg)
|
||||||
|
else:
|
||||||
|
dependencies = []
|
||||||
|
|
||||||
self.summary(slackbuilds, dependencies, option='remove')
|
self.summary(slackbuilds, dependencies, option='remove')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue