From d80cac19af96a809e8da5c44b5529f96bd74bf2a Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 21 Oct 2019 18:48:48 -0300 Subject: [PATCH] [aur] showing a popup when there are integrity issues with the source-files of a building package --- CHANGELOG.md | 3 +++ bauh/gems/arch/controller.py | 6 ++++++ bauh/gems/arch/makepkg.py | 3 +++ bauh/gems/arch/resources/locale/en | 4 +++- bauh/gems/arch/resources/locale/es | 4 +++- bauh/gems/arch/resources/locale/pt | 4 +++- 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf10061d..2a4e5387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.7.1] 2019- +### Improvements +- AUR: + - showing a "user-friendly" popup when there are integrity issues with the source-files of a building package ### Fixes - AUR: - update-checking for some scenarios diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index a62b97a2..358e1a59 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -490,6 +490,12 @@ class ArchManager(SoftwareManager): handler.watcher.print(self.i18n['action.cancelled']) return False + if check_res.get('validity_check'): + handler.watcher.show_message(title=self.i18n['arch.aur.install.validity_check.title'], + body=self.i18n['arch.aur.install.validity_check.body'].format(bold(pkgname)), + type_=MessageType.ERROR) + return False + return True def _install_optdeps(self, pkgname: str, root_password: str, handler: ProcessHandler, pkgdir: str, change_progress: bool = True) -> bool: diff --git a/bauh/gems/arch/makepkg.py b/bauh/gems/arch/makepkg.py index 2255dd12..3a72b002 100644 --- a/bauh/gems/arch/makepkg.py +++ b/bauh/gems/arch/makepkg.py @@ -18,4 +18,7 @@ def check(pkgdir: str, handler: ProcessHandler) -> dict: if gpg_keys: res['gpg_key'] = gpg_keys[0] + if 'One or more files did not pass the validity check' in output: + res['validity_check'] = True + return res diff --git a/bauh/gems/arch/resources/locale/en b/bauh/gems/arch/resources/locale/en index bb4deba5..47e1cc3b 100644 --- a/bauh/gems/arch/resources/locale/en +++ b/bauh/gems/arch/resources/locale/en @@ -60,4 +60,6 @@ arch.aur.install.pgp.receive_fail=Could not receive PGP key {} arch.aur.install.unknown_key.title=Public key required arch.install.aur.unknown_key.body=To continue {} installation is necessary to trust the following public key {} arch.aur.install.unknown_key.status=Receiving public key {} -arch.aur.install.unknown_key.receive_error=Could not receive public key {} \ No newline at end of file +arch.aur.install.unknown_key.receive_error=Could not receive public key {} +arch.aur.install.validity_check.title=Integrity issues +arch.aur.install.validity_check.body=Some of the source-files needed for {} installation are not healthy. The installation will be cancelled to avoid damages to your system. \ No newline at end of file diff --git a/bauh/gems/arch/resources/locale/es b/bauh/gems/arch/resources/locale/es index d97b21b0..d8a54105 100644 --- a/bauh/gems/arch/resources/locale/es +++ b/bauh/gems/arch/resources/locale/es @@ -92,4 +92,6 @@ arch.aur.install.pgp.sign_fail=No fue posible recibir la clave PGP {} arch.aur.install.unknown_key.title=Clave pública necesaria arch.aur.install.unknown_key.status=Recibiendo la clave pública {} arch.aur.install.unknown_key.receive_error=No fue posible recibir la clave pública {} -arch.install.aur.unknown_key.body=Para continuar la instalación de {} es necesario confiar en la siguiente clave pública {} \ No newline at end of file +arch.install.aur.unknown_key.body=Para continuar la instalación de {} es necesario confiar en la siguiente clave pública {} +arch.aur.install.validity_check.title=Problemas de integridad +arch.aur.install.validity_check.body=Algunos de los archivos fuente necesarios para la instalación de {} no están en buen estado. La instalación se cancelará para evitar daños a su sistema. \ No newline at end of file diff --git a/bauh/gems/arch/resources/locale/pt b/bauh/gems/arch/resources/locale/pt index 5b521483..a5d82578 100644 --- a/bauh/gems/arch/resources/locale/pt +++ b/bauh/gems/arch/resources/locale/pt @@ -92,4 +92,6 @@ arch.aur.install.pgp.receive_fail=Não foi possível receber a chave PGP {} arch.aur.install.unknown_key.title=Chave pública necessária arch.install.aur.unknown_key.body=Para continuar a instalação de {} é ncessário confiar na seguinte chave pública {} arch.aur.install.unknown_key.status=Recebendo a chave pública {} -arch.aur.install.unknown_key.receive_error=Não fui possível receber a chave pública {} \ No newline at end of file +arch.aur.install.unknown_key.receive_error=Não fui possível receber a chave pública {} +arch.aur.install.validity_check.title=Problemas de integridade +arch.aur.install.validity_check.body=Alguns dos arquivos-fonte necessários para instalação de {} não estão íntegros. A instalação será cancelada para evitar danos no seu sistema. \ No newline at end of file