[arch] fix -> displaying packages removed from AUR as AUR packages

This commit is contained in:
Vinicius Moreira
2021-01-14 17:27:27 -03:00
parent 7d539e0838
commit b8dd5c84e4
11 changed files with 28 additions and 8 deletions

View File

@@ -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
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.12/aur_removed.png">
</p>
- 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)

View File

@@ -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)

View File

@@ -41,6 +41,7 @@ arch.checking.conflicts=Sestà comprovant si hi ha conflictes amb {}
arch.checking.deps=Sestan comprovant les dependències de {}
arch.checking.missing_deps=Verificació de les dependències que falten de {}
arch.clone=Sestà clonant el dipòsit {} de lAUR
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 {}

View File

@@ -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 {}

View File

@@ -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 {}

View File

@@ -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 {}

View File

@@ -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 {}

View File

@@ -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 {}

View File

@@ -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 {}

View File

@@ -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 {}

View File

@@ -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 {}