From b8dd5c84e4ac8ce9ba079457625586255beeb753 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Thu, 14 Jan 2021 17:27:27 -0300 Subject: [PATCH] [arch] fix -> displaying packages removed from AUR as AUR packages --- CHANGELOG.md | 6 ++++++ bauh/gems/arch/controller.py | 21 +++++++++++++-------- bauh/gems/arch/resources/locale/ca | 1 + bauh/gems/arch/resources/locale/de | 1 + bauh/gems/arch/resources/locale/en | 1 + bauh/gems/arch/resources/locale/es | 1 + bauh/gems/arch/resources/locale/fr | 1 + bauh/gems/arch/resources/locale/it | 1 + bauh/gems/arch/resources/locale/pt | 1 + bauh/gems/arch/resources/locale/ru | 1 + bauh/gems/arch/resources/locale/tr | 1 + 11 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fac10f66..22b3f45e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Improvements - Arch - repositories/AUR search time (=~ -70%) + - new category to filter packages removed from AUR +

+ +

+ - Core - saving settings time (=~ -11%) - UI @@ -46,6 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - displaying "provided" repository packages on the search results (e.g: **nvidia** would appear as a package) - calling pacman to read installed packages when "Repositories" and "AUR" properties are set to "false" (it would not display the packages, but the call was unnecessary being done) - not displaying installed AUR packages when AUR support is disabled + - displaying packages removed from AUR as AUR packages - downloading AUR index during the initialization process when AUR support is disabled - Flatpak - crashing when trying to retrieve size of runtimes subcomponents [#164](https://github.com/vinifmor/bauh/issues/164) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index a7acef56..e96b9c65 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -530,7 +530,7 @@ class ArchManager(SoftwareManager): def _fill_repo_updates(self, updates: dict): updates.update(pacman.list_repository_updates()) - def _fill_repo_pkgs(self, repo_pkgs: dict, pkgs: list, aur_supported: bool, disk_loader: DiskCacheLoader): + def _fill_repo_pkgs(self, repo_pkgs: dict, pkgs: list, aur_index: Optional[Set[str]], disk_loader: DiskCacheLoader): updates = {} thread_updates = Thread(target=self._fill_repo_updates, args=(updates,), daemon=True) @@ -552,7 +552,7 @@ class ArchManager(SoftwareManager): i18n=self.i18n, installed=True, repository=pkgrepo, - categories=self.categories.get(name)) + categories=self.categories.get(name, [])) if updates: update_version = updates.get(pkg.name) @@ -564,11 +564,16 @@ class ArchManager(SoftwareManager): if disk_loader: disk_loader.fill(pkg, sync=True) - if not aur_supported and pkg.repository == 'aur': - pkg.repository = None # if AUR support is disabled, the repository should be reported as "unknown" + if pkg.repository == 'aur': + pkg.repository = None - if aur_supported or pkg.repository != 'aur': # this case happens when a package was removed from AUR - pkgs.append(pkg) + if aur_index and pkg.name not in aur_index: + removed_cat = self.i18n['arch.category.remove_from_aur'] + + if removed_cat not in pkg.categories: + pkg.categories.append(removed_cat) + + pkgs.append(pkg) def _wait_for_disk_cache(self): if self.disk_cache_updater and self.disk_cache_updater.is_alive(): @@ -610,7 +615,7 @@ class ArchManager(SoftwareManager): installed = pacman.map_installed(names=names) - aur_pkgs, repo_pkgs = None, None + aur_pkgs, repo_pkgs, aur_index = None, None, None if repos_supported: repo_pkgs = installed['signed'] @@ -647,7 +652,7 @@ class ArchManager(SoftwareManager): map_threads.append(t) if repo_pkgs: - t = Thread(target=self._fill_repo_pkgs, args=(repo_pkgs, pkgs, aur_supported, disk_loader), daemon=True) + t = Thread(target=self._fill_repo_pkgs, args=(repo_pkgs, pkgs, aur_index, disk_loader), daemon=True) t.start() map_threads.append(t) diff --git a/bauh/gems/arch/resources/locale/ca b/bauh/gems/arch/resources/locale/ca index a73540ed..61f5b388 100644 --- a/bauh/gems/arch/resources/locale/ca +++ b/bauh/gems/arch/resources/locale/ca @@ -41,6 +41,7 @@ arch.checking.conflicts=S’està comprovant si hi ha conflictes amb {} arch.checking.deps=S’estan comprovant les dependències de {} arch.checking.missing_deps=Verificació de les dependències que falten de {} arch.clone=S’està clonant el dipòsit {} de l’AUR +arch.category.remove_from_aur=Removed from AUR arch.config.aur=AUR packages arch.config.aur.tip=It allows to manage AUR packages. git must be installed. arch.config.aur_rebuild_detector=Check reinstallation need {} diff --git a/bauh/gems/arch/resources/locale/de b/bauh/gems/arch/resources/locale/de index f5d9c984..d9d3f46d 100644 --- a/bauh/gems/arch/resources/locale/de +++ b/bauh/gems/arch/resources/locale/de @@ -41,6 +41,7 @@ arch.checking.conflicts=Konflikte mit {} überprüfen arch.checking.deps={} Abhängigkeiten überprüfen arch.checking.missing_deps=Überprüfen der fehlenden Abhängigkeiten von {} arch.clone=AUR Repository {} wird kopiert +arch.category.remove_from_aur=Removed from AUR arch.config.aur=AUR packages arch.config.aur.tip=It allows to manage AUR packages. git must be installed. arch.config.aur_rebuild_detector=Check reinstallation need {} diff --git a/bauh/gems/arch/resources/locale/en b/bauh/gems/arch/resources/locale/en index 1da1c75f..c9bf4b82 100644 --- a/bauh/gems/arch/resources/locale/en +++ b/bauh/gems/arch/resources/locale/en @@ -41,6 +41,7 @@ arch.checking.conflicts=Checking any conflicts with {} arch.checking.deps=Checking {} dependencies arch.checking.missing_deps=Verifying missing dependencies of {} arch.clone=Cloning the AUR repository {} +arch.category.remove_from_aur=Removed from AUR arch.config.aur=AUR packages arch.config.aur.tip=It allows to manage AUR packages. git must be installed. arch.config.aur_rebuild_detector=Check reinstallation need {} diff --git a/bauh/gems/arch/resources/locale/es b/bauh/gems/arch/resources/locale/es index 13af4cfb..53833a8b 100644 --- a/bauh/gems/arch/resources/locale/es +++ b/bauh/gems/arch/resources/locale/es @@ -41,6 +41,7 @@ arch.checking.conflicts=Verificando se hay conflictos con {} arch.checking.deps=Verificando las dependencias de {} arch.checking.missing_deps=Verificando las dependencias faltantes de {} arch.clone=Clonando el repositorio {} de AUR +arch.category.remove_from_aur=Eliminado del AUR arch.config.aur=Paquetes de AUR arch.config.aur.tip=Permite gestionar paquetes del AUR. git debe estar instalado. arch.config.aur_rebuild_detector=Verificar necesidad de reinstalación {} diff --git a/bauh/gems/arch/resources/locale/fr b/bauh/gems/arch/resources/locale/fr index e1e1c834..582823f8 100644 --- a/bauh/gems/arch/resources/locale/fr +++ b/bauh/gems/arch/resources/locale/fr @@ -41,6 +41,7 @@ arch.checking.conflicts=Vérification de conflits aved {} arch.checking.deps=Vérification des dépendances de {} arch.checking.missing_deps=Vérification des dépendances manquantes de {} arch.clone=Copie du dépôt AUR {} +arch.category.remove_from_aur=Removed from AUR arch.config.aur=Paquêts AUR arch.config.aur.tip=Permet la gestion des paquets AUR. git doit être installé. arch.config.aur_rebuild_detector=Check reinstallation need {} diff --git a/bauh/gems/arch/resources/locale/it b/bauh/gems/arch/resources/locale/it index 3d4742f3..a33825b6 100644 --- a/bauh/gems/arch/resources/locale/it +++ b/bauh/gems/arch/resources/locale/it @@ -41,6 +41,7 @@ arch.checking.conflicts=Verifica di eventuali conflitti con {} arch.checking.deps=Verifica di {} dipendenze arch.checking.missing_deps=Verifica delle dipendenze mancanti di {} arch.clone=Clonazione del repository AUR {} +arch.category.remove_from_aur=Removed from AUR arch.config.aur=AUR packages arch.config.aur.tip=It allows to manage AUR packages. git must be installed. arch.config.aur_rebuild_detector=Check reinstallation need {} diff --git a/bauh/gems/arch/resources/locale/pt b/bauh/gems/arch/resources/locale/pt index 1c9f55b1..f91518dd 100644 --- a/bauh/gems/arch/resources/locale/pt +++ b/bauh/gems/arch/resources/locale/pt @@ -41,6 +41,7 @@ arch.checking.conflicts=Verificando se há conflitos com {} arch.checking.deps=Verificando as dependências de {} arch.checking.missing_deps=Verificando dependências ausentes de {} arch.clone=Clonando o repositório {} do AUR +arch.category.remove_from_aur=Removido do AUR arch.config.aur=Pacotes do AUR arch.config.aur.tip=Permite gerenciar pacotes dos AUR. git precisa estar instalado. arch.config.aur_rebuild_detector=Verificar necessidade de reinstalação {} diff --git a/bauh/gems/arch/resources/locale/ru b/bauh/gems/arch/resources/locale/ru index 7dd07afd..30e86994 100644 --- a/bauh/gems/arch/resources/locale/ru +++ b/bauh/gems/arch/resources/locale/ru @@ -41,6 +41,7 @@ arch.checking.conflicts=Проверка конфликтов с {} arch.checking.deps=Проверка зависимостей {} arch.checking.missing_deps=Проверка отсутствующих зависимостей {} arch.clone=Клонирование AUR-репозитория {} +arch.category.remove_from_aur=Removed from AUR arch.config.aur=пакеты AUR arch.config.aur.tip=Это позволяет управлять пакетами AUR. git должен быть установлен. arch.config.aur_rebuild_detector=Check reinstallation need {} diff --git a/bauh/gems/arch/resources/locale/tr b/bauh/gems/arch/resources/locale/tr index 0ebb0965..9937a22a 100644 --- a/bauh/gems/arch/resources/locale/tr +++ b/bauh/gems/arch/resources/locale/tr @@ -41,6 +41,7 @@ arch.checking.conflicts={} ile çakışmalar kontrol ediliyor arch.checking.deps={} bağımlılıkları kontrol ediliyor arch.checking.missing_deps={} eksik bağımlılıkları kontrol ediliyor arch.clone=AUR deposu kopyalanıyor {} +arch.category.remove_from_aur=Removed from AUR arch.config.aur=AUR paketleri arch.config.aur.tip=AUR paketlerinin yönetilmesine izin verir. git yüklenmeli. arch.config.aur_rebuild_detector=Check reinstallation need {}