From 5901c4ceeacc27fad843b842d6fd9573915f6157 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 1 Jun 2020 10:58:46 -0300 Subject: [PATCH] [fix][arch] not checking if **pacman-mirrors** is available before starting to download repository packages --- CHANGELOG.md | 8 ++++++++ bauh/__init__.py | 2 +- bauh/gems/arch/controller.py | 4 +++- bauh/gems/arch/resources/locale/ca | 2 +- bauh/gems/arch/resources/locale/de | 2 +- bauh/gems/arch/resources/locale/en | 2 +- bauh/gems/arch/resources/locale/es | 2 +- bauh/gems/arch/resources/locale/it | 2 +- bauh/gems/arch/resources/locale/pt | 2 +- bauh/gems/arch/resources/locale/ru | 2 +- bauh/gems/arch/resources/locale/tr | 2 +- 11 files changed, 20 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e89dbd72..f3f02e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,15 @@ 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.9.5] 2020 + +### Fixes +- Arch + - not checking if **pacman-mirrors** is available before starting to download repository packages (when multi-threaded download is enabled) [#117](https://github.com/vinifmor/bauh/issues/117) + + ## [0.9.4] 2020-05-29 + ### Features - Ignore updates: now it is possible to ignore updates from software packages through their actions button (**+**). Supported types: Arch packages, Flatpaks and AppImages diff --git a/bauh/__init__.py b/bauh/__init__.py index 22e3cc94..3589bf38 100644 --- a/bauh/__init__.py +++ b/bauh/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.9.4' +__version__ = '0.9.5' __app_name__ = 'bauh' import os diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 78abfc7e..dec9176c 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -1627,7 +1627,9 @@ class ArchManager(SoftwareManager): return True def _should_download_packages(self, arch_config: dict) -> bool: - return bool(arch_config['repositories_mthread_download']) and self.context.file_downloader.is_multithreaded() + return bool(arch_config['repositories_mthread_download']) \ + and self.context.file_downloader.is_multithreaded() \ + and pacman.is_mirrors_available() def _download_packages(self, pkgnames: List[str], handler: ProcessHandler, root_password: str, sizes: Dict[str, int] = None) -> int: download_service = MultithreadedDownloadService(file_downloader=self.context.file_downloader, diff --git a/bauh/gems/arch/resources/locale/ca b/bauh/gems/arch/resources/locale/ca index 7dea4676..b6d7882b 100644 --- a/bauh/gems/arch/resources/locale/ca +++ b/bauh/gems/arch/resources/locale/ca @@ -29,7 +29,7 @@ arch.config.mirrors_sort_limit.tip=Defines the maximum number of mirrors that wi arch.config.optimize=optimize arch.config.optimize.tip=La configuració optimitzada s'utilitzarà per fer més ràpida la instal·lació, actualització i reversió dels paquets, en cas contrari s'utilitzarà la configuració del sistema. arch.config.pacman_mthread_download=Multithreaded download (repositories) -arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). +arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed. arch.config.refresh_mirrors=Refresh mirrors on startup arch.config.refresh_mirrors.tip=Refresh the package mirrors once a day on startup ( or after a device reboot ) arch.config.repos=Repositories packages diff --git a/bauh/gems/arch/resources/locale/de b/bauh/gems/arch/resources/locale/de index 4567bc4b..f67865a0 100644 --- a/bauh/gems/arch/resources/locale/de +++ b/bauh/gems/arch/resources/locale/de @@ -29,7 +29,7 @@ arch.config.mirrors_sort_limit.tip=Defines the maximum number of mirrors that wi arch.config.optimize=optimize arch.config.optimize.tip=Optimized settings will be used in order to make the packages installation, upgrading and downgrading faster, otherwise the system settings will be used arch.config.pacman_mthread_download=Multithreaded download (repositories) -arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). +arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed. arch.config.refresh_mirrors=Refresh mirrors on startup arch.config.refresh_mirrors.tip=Refresh the package mirrors once a day on startup ( or after a device reboot ) arch.config.repos=Repositories packages diff --git a/bauh/gems/arch/resources/locale/en b/bauh/gems/arch/resources/locale/en index e63c29dd..59fa52f5 100644 --- a/bauh/gems/arch/resources/locale/en +++ b/bauh/gems/arch/resources/locale/en @@ -29,7 +29,7 @@ arch.config.mirrors_sort_limit.tip=Defines the maximum number of mirrors that wi arch.config.optimize=optimize arch.config.optimize.tip=Optimized settings will be used in order to make the packages installation, upgrading and downgrading faster, otherwise the system settings will be used arch.config.pacman_mthread_download=Multi-threaded download (repositories) -arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). +arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed. arch.config.refresh_mirrors=Refresh mirrors on startup arch.config.refresh_mirrors.tip=Refresh the package mirrors once a day on startup ( or after a device reboot ) arch.config.repos=Repositories packages diff --git a/bauh/gems/arch/resources/locale/es b/bauh/gems/arch/resources/locale/es index 25f340dc..1c912e65 100644 --- a/bauh/gems/arch/resources/locale/es +++ b/bauh/gems/arch/resources/locale/es @@ -29,7 +29,7 @@ arch.config.mirrors_sort_limit.tip=Define el número máximo de espejos que se u arch.config.optimize=optimizar arch.config.optimize.tip=Se usará la configuración optimizada para que la instalación, actualización y reversión de los paquetes sean más rápidas, de lo contrario se usará la configuración del sistema arch.config.pacman_mthread_download=Descarga segmentada (repositorios) -arch.config.pacman_mthread_download.tip=Si los paquetes de los repositorios deben descargarse con una herramienta que usa segmentación/threads (puede ser más rápido). +arch.config.pacman_mthread_download.tip=Si los paquetes de los repositorios deben descargarse con una herramienta que usa segmentación/threads (puede ser más rápido). pacman-mirrors necesita estar instalado. arch.config.refresh_mirrors=Actualizar espejos al iniciar arch.config.refresh_mirrors.tip=Actualiza los espejos de paquetes una vez al día al iniciar ( o después de reiniciar el dispositivo ) arch.config.repos=Paquetes de repositorios diff --git a/bauh/gems/arch/resources/locale/it b/bauh/gems/arch/resources/locale/it index a84f356c..12df9b7f 100644 --- a/bauh/gems/arch/resources/locale/it +++ b/bauh/gems/arch/resources/locale/it @@ -29,7 +29,7 @@ arch.config.mirrors_sort_limit.tip=Defines the maximum number of mirrors that wi arch.config.optimize=optimize arch.config.optimize.tip=Verranno utilizzate le impostazioni ottimizzate per velocizzare l'installazione, l'aggiornamento e l'inversione dei pacchetti, altrimenti verranno utilizzate le impostazioni di sistema arch.config.pacman_mthread_download=Multithreaded download (repositories) -arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). +arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed. arch.config.refresh_mirrors=Refresh mirrors on startup arch.config.refresh_mirrors.tip=Refresh the package mirrors once a day on startup ( or after a device reboot ) arch.config.repos=Repositories packages diff --git a/bauh/gems/arch/resources/locale/pt b/bauh/gems/arch/resources/locale/pt index 6f4c242d..d817da5e 100644 --- a/bauh/gems/arch/resources/locale/pt +++ b/bauh/gems/arch/resources/locale/pt @@ -28,7 +28,7 @@ arch.config.mirrors_sort_limit=Limite de ordenação de espelhos arch.config.mirrors_sort_limit.tip=Define o número máximo de espelhos que serão utilizados para a ordenação por velocidade. Use 0 para não limitar ou deixe em branco para desabilitar a ordenação. arch.config.optimize=Otimizar arch.config.pacman_mthread_download=Download segmentado (repositórios) -arch.config.pacman_mthread_download.tip=Se os pacotes dos repositórios devem baixados através de uma ferramenta que trabalha com segmentação/threads (pode ser mais rápido). +arch.config.pacman_mthread_download.tip=Se os pacotes dos repositórios devem baixados através de uma ferramenta que trabalha com segmentação/threads (pode ser mais rápido). pacman-mirrors precisa estar instalado. arch.config.refresh_mirrors=Atualizar espelhos ao iniciar arch.config.refresh_mirrors.tip=Atualiza os espelhos de pacotes uma vez ao dia na inicialização arch.config.repos=Pacotes de repositórios diff --git a/bauh/gems/arch/resources/locale/ru b/bauh/gems/arch/resources/locale/ru index 2e6fcaa7..cdf5eeac 100644 --- a/bauh/gems/arch/resources/locale/ru +++ b/bauh/gems/arch/resources/locale/ru @@ -29,7 +29,7 @@ arch.config.mirrors_sort_limit.tip=Определяет максимальное arch.config.optimize=Оптимизация arch.config.optimize.tip=Оптимизированные настройки будут использоваться для ускорения установки пакетов, в противном случае будут использоваться системные настройки arch.config.pacman_mthread_download=Multithreaded download (repositories) -arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). +arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed. arch.config.refresh_mirrors=Обновить зеркала при запуске arch.config.refresh_mirrors.tip=Обновляйте зеркала пакета один раз в день при запуске (или после перезагрузки устройства) arch.config.repos=Пакеты репозиториев diff --git a/bauh/gems/arch/resources/locale/tr b/bauh/gems/arch/resources/locale/tr index 383b8a97..98b2d95e 100644 --- a/bauh/gems/arch/resources/locale/tr +++ b/bauh/gems/arch/resources/locale/tr @@ -29,7 +29,7 @@ arch.config.mirrors_sort_limit.tip=Hız sıralama için kullanılacak maksimum y arch.config.optimize=optimize arch.config.optimize.tip=Paketlerin kurulumunu, yükseltilmesini ve indirilmesini hızlandırmak için optimize edilmiş ayarlar kullanılacak, aksi takdirde sistem ayarları kullanılacak arch.config.pacman_mthread_download=Multithreaded download (repositories) -arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). +arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed. arch.config.refresh_mirrors=Başlangıçta yansıları yenile arch.config.refresh_mirrors.tip=Paket yansılarını başlangıçta günde bir kez (veya cihaz yeniden başlatıldıktan sonra) yenileyin arch.config.repos=Depo paketleri