From e44ce833d536da568b154c9fbd826ee1c023f996 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 23 Sep 2019 14:42:44 -0300 Subject: [PATCH] aur: not validating PGP keys if threre are missings deps --- bauh/gems/arch/controller.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 6c884f26..c4461b61 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -426,18 +426,6 @@ class ArchManager(SoftwareManager): check_res = makepkg.check(pkgdir, handler.watcher) if check_res: - if check_res.get('gpg_key'): - if handler.watcher.request_confirmation(title=self.i18n['arch.aur.install.unknown_key.title'], - body=self.i18n['arch.install.aur.unknown_key.body'].format(bold(pkgname), bold(check_res['gpg_key']))): - handler.watcher.change_substatus(self.i18n['arch.aur.install.unknown_key.status'].format(bold(check_res['gpg_key']))) - if not handler.handle(gpg.receive_key(check_res['gpg_key'])): - handler.watcher.show_message(title=self.i18n['error'], - body=self.i18n['arch.aur.install.unknown_key.receive_error'].format(bold(check_res['gpg_key']))) - return False - else: - handler.watcher.print(self.i18n['action.cancelled']) - return False - if check_res.get('missing_deps'): depnames = {RE_SPLIT_VERSION.split(dep)[0] for dep in check_res['missing_deps']} dep_mirrors = self._map_mirrors(depnames) @@ -459,6 +447,21 @@ class ArchManager(SoftwareManager): message.show_dep_not_installed(handler.watcher, pkgname, dep_not_installed, self.i18n) return False + # it is necessary to re-check because missing PGP keys are only notified when there are none missing + return self._install_missings_deps_and_keys(pkgname, root_password, handler, pkgdir) + + if check_res.get('gpg_key'): + if handler.watcher.request_confirmation(title=self.i18n['arch.aur.install.unknown_key.title'], + body=self.i18n['arch.install.aur.unknown_key.body'].format(bold(pkgname), bold(check_res['gpg_key']))): + handler.watcher.change_substatus(self.i18n['arch.aur.install.unknown_key.status'].format(bold(check_res['gpg_key']))) + if not handler.handle(gpg.receive_key(check_res['gpg_key'])): + handler.watcher.show_message(title=self.i18n['error'], + body=self.i18n['arch.aur.install.unknown_key.receive_error'].format(bold(check_res['gpg_key']))) + return False + else: + handler.watcher.print(self.i18n['action.cancelled']) + return False + return True def _install_optdeps(self, pkgname: str, root_password: str, handler: ProcessHandler, pkgdir: str, change_progress: bool = True) -> bool: