From 9b17407067ac5b436a2388a2b3f68afbb03f7e33 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 22 Oct 2019 13:20:31 -0300 Subject: [PATCH] [appimage] showing an error popup when AppImageLauncher messes up with an application installation --- CHANGELOG.md | 2 ++ bauh/gems/appimage/controller.py | 12 ++++++++++-- bauh/gems/appimage/resources/locale/en | 3 ++- bauh/gems/appimage/resources/locale/es | 3 ++- bauh/gems/appimage/resources/locale/pt | 3 ++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c376530a..0631d5ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Improvements - 3 password attempts for root authentication +- AppImage: + - showing an error popup when **AppImageLauncher** messes up with an application installation - AUR: - showing a "user-friendly" popup when there are integrity issues with the source-files of a building package diff --git a/bauh/gems/appimage/controller.py b/bauh/gems/appimage/controller.py index 51ba3827..1d910b65 100644 --- a/bauh/gems/appimage/controller.py +++ b/bauh/gems/appimage/controller.py @@ -17,7 +17,7 @@ from bauh.api.abstract.model import SoftwarePackage, PackageHistory, PackageUpda from bauh.api.abstract.view import MessageType from bauh.api.constants import HOME_PATH from bauh.commons.html import bold -from bauh.commons.system import SystemProcess, new_subprocess, ProcessHandler, run_cmd +from bauh.commons.system import SystemProcess, new_subprocess, ProcessHandler, run_cmd, SimpleProcess from bauh.gems.appimage import query, INSTALLATION_PATH, suggestions, db from bauh.gems.appimage.model import AppImage from bauh.gems.appimage.worker import DatabaseUpdater @@ -298,12 +298,20 @@ class AppImageManager(SoftwareManager): watcher.change_substatus(self.i18n['appimage.install.extract'].format(bold(file_name))) try: - handler.handle(SystemProcess(new_subprocess([file_path, '--appimage-extract'], cwd=out_dir))) + res, output = handler.handle_simple(SimpleProcess([file_path, '--appimage-extract'], cwd=out_dir)) + + if 'Error: Failed to register AppImage in AppImageLauncherFS' in output: + watcher.show_message(title=self.i18n['error'], + body=self.i18n['appimage.install.appimagelauncher.error'].format(appimgl=bold('AppImageLauncher'), app=bold(pkg.name)), + type_=MessageType.ERROR) + handler.handle(SystemProcess(new_subprocess(['rm', '-rf', out_dir]))) + return False except: watcher.show_message(title=self.i18n['error'], body=traceback.format_exc(), type_=MessageType.ERROR) traceback.print_exc() + handler.handle(SystemProcess(new_subprocess(['rm', '-rf', out_dir]))) return False watcher.change_substatus(self.i18n['appimage.install.desktop_entry']) diff --git a/bauh/gems/appimage/resources/locale/en b/bauh/gems/appimage/resources/locale/en index e8a04789..0a4c5a07 100644 --- a/bauh/gems/appimage/resources/locale/en +++ b/bauh/gems/appimage/resources/locale/en @@ -15,4 +15,5 @@ appimage.downgrade.unknown_version.body=It was not possible to identify {} curre appimage.downgrade.first_version={} is in its first published version appimage.error.uninstall_current_version=It was not possible to uninstall the current version of {} appimage.downgrade.install_version=It was not possible to install the version {} ({}) -appimage.install.download.error=It was not possible to download the file {}. The file server can be down. \ No newline at end of file +appimage.install.download.error=It was not possible to download the file {}. The file server can be down. +appimage.install.appimagelauncher.error={appimgl} is not allowing {app} to be installed. Uninstall {appimgl}, reboot your system and try to install {app} again. \ No newline at end of file diff --git a/bauh/gems/appimage/resources/locale/es b/bauh/gems/appimage/resources/locale/es index ab80dbbe..932e3fa1 100644 --- a/bauh/gems/appimage/resources/locale/es +++ b/bauh/gems/appimage/resources/locale/es @@ -15,4 +15,5 @@ appimage.downgrade.unknown_version.body=No fue posible identificar la versión a appimage.downgrade.first_version={} está en su primera versión publicada appimage.downgrade.uninstall_current_version=No fue posible desinstalar la versión actual de {} appimage.downgrade.install_version=No fue posible instalar la versión {} ({}) -appimage.install.download.error=No fue posible descargar el archivo {}. El servidor del archivo puede estar inactivo. \ No newline at end of file +appimage.install.download.error=No fue posible descargar el archivo {}. El servidor del archivo puede estar inactivo. +appimage.install.appimagelauncher.error = {appimgl} no permite la instalación de {app}. Desinstale {appimgl}, reinicie su sistema e intente instalar {app} nuevamente. \ No newline at end of file diff --git a/bauh/gems/appimage/resources/locale/pt b/bauh/gems/appimage/resources/locale/pt index 1f41b7dc..43ae6917 100644 --- a/bauh/gems/appimage/resources/locale/pt +++ b/bauh/gems/appimage/resources/locale/pt @@ -15,4 +15,5 @@ appimage.downgrade.unknown_version.body=Não foi possível identificar a versão appimage.downgrade.first_version={} se encontra em sua primeira versão publicada appimage.downgrade.uninstall_current_version=Não foi possível desinstalar a versão atual de {} appimage.downgrade.install_version=Não foi possivel instalar a versão {} ({}) -appimage.install.download.error=Não foi possível baixar o arquivo {}. O servidor do arquivo pode estar fora do ar. \ No newline at end of file +appimage.install.download.error=Não foi possível baixar o arquivo {}. O servidor do arquivo pode estar fora do ar. +appimage.install.appimagelauncher.error={appimgl} não está permitindo que o {app} seja instalado. Desinstale o {appimgl}, reinicie o sistema e tente instalar o {app} novamente. \ No newline at end of file