mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 06:34:15 +02:00
[improvement][arch] unifying the process output when upgrading several repo packages to prevent wrong error returns
This commit is contained in:
@@ -728,7 +728,7 @@ class ArchManager(SoftwareManager):
|
||||
try:
|
||||
output_handler = TransactionStatusHandler(watcher, self.i18n, len(repo_pkgs_names), self.logger)
|
||||
output_handler.start()
|
||||
success = handler.handle(pacman.upgrade_several(repo_pkgs_names, root_password), output_handler=output_handler.handle)
|
||||
success = handler.handle_simple(pacman.upgrade_several(repo_pkgs_names, root_password), output_handler=output_handler.handle)
|
||||
output_handler.stop_working()
|
||||
output_handler.join()
|
||||
|
||||
@@ -741,7 +741,7 @@ class ArchManager(SoftwareManager):
|
||||
disk.save_several(repo_pkgs_names, repo_map=repo_map, overwrite=True, maintainer=None)
|
||||
|
||||
else:
|
||||
self.logger.error("An error occurred while upgrading repository packages")
|
||||
self.logger.error("'pacman' returned an unexpected response after upgrading the repository packages")
|
||||
return False
|
||||
except:
|
||||
watcher.change_substatus('')
|
||||
|
||||
@@ -691,12 +691,8 @@ def list_installed_names() -> Set[str]:
|
||||
return {p for p in run_cmd('pacman -Qq').split('\n') if p}
|
||||
|
||||
|
||||
def upgrade_several(pkgnames: Iterable[str], root_password: str) -> SystemProcess:
|
||||
cmd = ['pacman', '-S', *pkgnames, '--noconfirm']
|
||||
if root_password:
|
||||
return SystemProcess(new_root_subprocess(cmd, root_password), wrong_error_phrase='warning:')
|
||||
else:
|
||||
return SystemProcess(new_subprocess(cmd), wrong_error_phrase='warning:')
|
||||
def upgrade_several(pkgnames: Iterable[str], root_password: str) -> SimpleProcess:
|
||||
return SimpleProcess(cmd=['pacman', '-S', *pkgnames, '--noconfirm'], root_password=root_password)
|
||||
|
||||
|
||||
def remove_several(pkgnames: Iterable[str], root_password: str) -> SystemProcess:
|
||||
|
||||
Reference in New Issue
Block a user