mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[appimage] improvement: not stopping the upgrade process when one of several applications have been selected to upgrade
This commit is contained in:
@@ -359,29 +359,40 @@ class AppImageManager(SoftwareManager):
|
||||
return False
|
||||
|
||||
def upgrade(self, requirements: UpgradeRequirements, root_password: str, watcher: ProcessWatcher) -> bool:
|
||||
not_upgraded = []
|
||||
|
||||
for req in requirements.to_upgrade:
|
||||
watcher.change_status("{} {} ({})...".format(self.i18n['manage_window.status.upgrading'], req.pkg.name, req.pkg.version))
|
||||
|
||||
download_data = self._download(req.pkg, watcher)
|
||||
|
||||
if not download_data:
|
||||
return False
|
||||
not_upgraded.append(req.pkg)
|
||||
watcher.change_substatus('')
|
||||
continue
|
||||
|
||||
if not self.uninstall(req.pkg, root_password, watcher).success:
|
||||
watcher.show_message(title=self.i18n['error'],
|
||||
body=self.i18n['appimage.error.uninstall_current_version'],
|
||||
type_=MessageType.ERROR)
|
||||
not_upgraded.append(req.pkg)
|
||||
watcher.change_substatus('')
|
||||
return False
|
||||
continue
|
||||
|
||||
if not self._install(pkg=req.pkg, watcher=watcher, pre_downloaded_file=download_data).success:
|
||||
not_upgraded.append(req.pkg)
|
||||
watcher.change_substatus('')
|
||||
return False
|
||||
continue
|
||||
|
||||
self.cache_to_disk(req.pkg, None, False)
|
||||
|
||||
all_failed = len(not_upgraded) == len(requirements.to_upgrade)
|
||||
|
||||
if not_upgraded:
|
||||
pkgs_str = ''.join((f'<li>{app.name}</li>' for app in not_upgraded))
|
||||
watcher.show_message(title=self.i18n['error' if all_failed else 'warning'].capitalize(),
|
||||
body=self.i18n['appimage.upgrade.failed'].format(apps=f'<ul>{pkgs_str}</ul>'),
|
||||
type_=MessageType.ERROR if all_failed else MessageType.WARNING)
|
||||
|
||||
watcher.change_substatus('')
|
||||
return True
|
||||
return not all_failed
|
||||
|
||||
def uninstall(self, pkg: AppImage, root_password: str, watcher: ProcessWatcher, disk_loader: DiskCacheLoader = None) -> TransactionResult:
|
||||
if os.path.exists(pkg.get_disk_cache_path()):
|
||||
|
||||
@@ -36,6 +36,7 @@ appimage.install.permission=S’està concedint el permís d’execució a {}
|
||||
appimage.update_database.deleting_old=Removing old files
|
||||
appimage.update_database.downloading=Downloading database files
|
||||
appimage.update_database.uncompressing=Uncompressing files
|
||||
appimage.upgrade.failed=It was not possible to upgrade the following applications: {apps}
|
||||
appimage.task.db_update=Actualització de bases de dades
|
||||
appimage.task.db_update.checking=Checking for updates
|
||||
appimage.task.suggestions=Downloading suggestions
|
||||
|
||||
@@ -36,6 +36,7 @@ appimage.install.permission=Ausführberechtigungen für {}
|
||||
appimage.update_database.deleting_old=Removing old files
|
||||
appimage.update_database.downloading=Downloading database files
|
||||
appimage.update_database.uncompressing=Uncompressing files
|
||||
appimage.upgrade.failed=It was not possible to upgrade the following applications: {apps}
|
||||
appimage.task.db_update=Updating databases
|
||||
appimage.task.db_update.checking=Checking for updates
|
||||
appimage.task.suggestions=Downloading suggestions
|
||||
|
||||
@@ -36,6 +36,7 @@ appimage.install.permission=Giving execution permission to {}
|
||||
appimage.update_database.deleting_old=Removing old files
|
||||
appimage.update_database.downloading=Downloading database files
|
||||
appimage.update_database.uncompressing=Uncompressing files
|
||||
appimage.upgrade.failed=It was not possible to upgrade the following applications: {apps}
|
||||
appimage.task.db_update=Updating databases
|
||||
appimage.task.db_update.checking=Checking for updates
|
||||
appimage.task.suggestions=Downloading suggestions
|
||||
|
||||
@@ -36,6 +36,7 @@ appimage.install.permission=Concediendo permiso de ejecución a {}
|
||||
appimage.update_database.deleting_old=Eliminando archivos antiguos
|
||||
appimage.update_database.downloading=Descargando archivos de la base de datos
|
||||
appimage.update_database.uncompressing=Descomprindo archivos
|
||||
appimage.upgrade.failed=No fue posible actualizar las siguientes aplicaciones: {apps}
|
||||
appimage.task.db_update=Actualizando base de datos
|
||||
appimage.task.db_update.checking=Buscando actualizaciones
|
||||
appimage.task.suggestions=Descargando sugerencias
|
||||
|
||||
@@ -35,6 +35,7 @@ appimage.install.permission={} est maintenant exécutable
|
||||
appimage.update_database.deleting_old=Removing old files
|
||||
appimage.update_database.downloading=Downloading database files
|
||||
appimage.update_database.uncompressing=Uncompressing files
|
||||
appimage.upgrade.failed=It was not possible to upgrade the following applications: {apps}
|
||||
appimage.task.db_update=Mise à jour des bases de données
|
||||
appimage.task.db_update.checking=Checking for updates
|
||||
appimage.task.suggestions=Downloading suggestions
|
||||
|
||||
@@ -36,6 +36,7 @@ appimage.install.permission=Gdare il permesso di esecuzione a {}
|
||||
appimage.update_database.deleting_old=Removing old files
|
||||
appimage.update_database.downloading=Downloading database files
|
||||
appimage.update_database.uncompressing=Uncompressing files
|
||||
appimage.upgrade.failed=It was not possible to upgrade the following applications: {apps}
|
||||
appimage.task.db_update=Aggiornamento dei database
|
||||
appimage.task.db_update.checking=Checking for updates
|
||||
appimage.task.suggestions=Downloading suggestions
|
||||
|
||||
@@ -36,6 +36,7 @@ appimage.install.permission=Concedendo permissão de execução para {}
|
||||
appimage.update_database.deleting_old=Removendo arquicos antigos
|
||||
appimage.update_database.downloading=Baixando arquivos do banco de dados
|
||||
appimage.update_database.uncompressing=Descomprimindo arquivos
|
||||
appimage.upgrade.failed=Não foi possível atualizar as seguintes aplicações: {apps}
|
||||
appimage.task.db_update=Atualizando base de dados
|
||||
appimage.task.db_update.checking=Checando atualizações
|
||||
appimage.task.suggestions=Baixando sugestões
|
||||
|
||||
@@ -36,6 +36,7 @@ appimage.install.permission=Установить права на выполне
|
||||
appimage.update_database.deleting_old=Removing old files
|
||||
appimage.update_database.downloading=Downloading database files
|
||||
appimage.update_database.uncompressing=Uncompressing files
|
||||
appimage.upgrade.failed=It was not possible to upgrade the following applications: {apps}
|
||||
appimage.task.db_update=Обновление базы данных
|
||||
appimage.task.db_update.checking=Checking for updates
|
||||
appimage.task.suggestions=Downloading suggestions
|
||||
|
||||
@@ -36,6 +36,7 @@ appimage.install.permission={} için yürütme izni veriliyor
|
||||
appimage.update_database.deleting_old=Removing old files
|
||||
appimage.update_database.downloading=Downloading database files
|
||||
appimage.update_database.uncompressing=Uncompressing files
|
||||
appimage.upgrade.failed=It was not possible to upgrade the following applications: {apps}
|
||||
appimage.task.db_update=Veritabanları güncelleniyor
|
||||
appimage.task.db_update.checking=Checking for updates
|
||||
appimage.task.suggestions=Downloading suggestions
|
||||
|
||||
Reference in New Issue
Block a user