mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 20:54:15 +02:00
[arch] feature: able to filter orphan packages by the new 'orphan' category (AUR only)
This commit is contained in:
@@ -28,6 +28,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.10.0/appim_self.png">
|
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.10.0/appim_self.png">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
- Arch
|
||||||
|
- AUR:
|
||||||
|
- able to filter orphan packages by the new "orphan" category [#236](https://github.com/vinifmor/bauh/issues/236)
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
- General
|
- General
|
||||||
- minor memory improvements
|
- minor memory improvements
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from typing import Optional
|
from typing import Optional, List, Dict
|
||||||
|
|
||||||
from bauh.api.abstract.model import PackageStatus
|
from bauh.api.abstract.model import PackageStatus
|
||||||
from bauh.api.http import HttpClient
|
from bauh.api.http import HttpClient
|
||||||
@@ -80,7 +80,7 @@ class AURDataMapper:
|
|||||||
if res and res.status_code == 200 and res.text:
|
if res and res.status_code == 200 and res.text:
|
||||||
pkg.pkgbuild = res.text
|
pkg.pkgbuild = res.text
|
||||||
|
|
||||||
def map_api_data(self, apidata: dict, pkgs_installed: Optional[dict], categories: dict) -> ArchPackage:
|
def map_api_data(self, apidata: dict, pkgs_installed: Optional[dict], categories: Dict[str, List[str]]) -> ArchPackage:
|
||||||
data = pkgs_installed.get(apidata.get('Name')) if pkgs_installed else None
|
data = pkgs_installed.get(apidata.get('Name')) if pkgs_installed else None
|
||||||
app = ArchPackage(name=apidata.get('Name'), installed=bool(data), repository='aur', i18n=self.i18n)
|
app = ArchPackage(name=apidata.get('Name'), installed=bool(data), repository='aur', i18n=self.i18n)
|
||||||
app.status = PackageStatus.LOADING_DATA
|
app.status = PackageStatus.LOADING_DATA
|
||||||
@@ -93,6 +93,13 @@ class AURDataMapper:
|
|||||||
app.description = data.get('description')
|
app.description = data.get('description')
|
||||||
|
|
||||||
self.fill_api_data(app, apidata, fill_version=not data)
|
self.fill_api_data(app, apidata, fill_version=not data)
|
||||||
|
|
||||||
|
if app.orphan:
|
||||||
|
if app.categories is None:
|
||||||
|
app.categories = []
|
||||||
|
|
||||||
|
app.categories.append('orphan')
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
||||||
def check_update(self, pkg: ArchPackage, last_modified: Optional[int]) -> bool:
|
def check_update(self, pkg: ArchPackage, last_modified: Optional[int]) -> bool:
|
||||||
|
|||||||
@@ -189,6 +189,9 @@ class ArchPackage(SoftwarePackage):
|
|||||||
for a in self.cached_attrs():
|
for a in self.cached_attrs():
|
||||||
val = data.get(a)
|
val = data.get(a)
|
||||||
if val:
|
if val:
|
||||||
|
if a == 'categories' and isinstance(val, list) and 'orphan' in val:
|
||||||
|
val.remove('orphan')
|
||||||
|
|
||||||
setattr(self, a, val)
|
setattr(self, a, val)
|
||||||
|
|
||||||
if a == 'icon_path':
|
if a == 'icon_path':
|
||||||
|
|||||||
@@ -302,6 +302,7 @@ arch.warning.aur_missing_dep={} seems not to be installed. It will not be possib
|
|||||||
arch_repo.history.1_version=versió
|
arch_repo.history.1_version=versió
|
||||||
arch_repo.history.2_release=publicació
|
arch_repo.history.2_release=publicació
|
||||||
arch_repo.history.3_date=data
|
arch_repo.history.3_date=data
|
||||||
|
category.orphan=orphan
|
||||||
aur.history.1_version=versió
|
aur.history.1_version=versió
|
||||||
aur.history.2_release=publicació
|
aur.history.2_release=publicació
|
||||||
aur.history.3_date=data
|
aur.history.3_date=data
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ arch_repo.history.3_date=Datum
|
|||||||
aur.history.1_version=Version
|
aur.history.1_version=Version
|
||||||
aur.history.2_release=Release
|
aur.history.2_release=Release
|
||||||
aur.history.3_date=Datum
|
aur.history.3_date=Datum
|
||||||
|
category.orphan=orphan
|
||||||
gem.arch.info=Software packages available for distributions based on Arch Linux
|
gem.arch.info=Software packages available for distributions based on Arch Linux
|
||||||
gem.arch.label=Arch
|
gem.arch.label=Arch
|
||||||
gem.arch.type.arch_repo.label=Arch - Repository
|
gem.arch.type.arch_repo.label=Arch - Repository
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ arch_repo.history.3_date=date
|
|||||||
aur.history.1_version=version
|
aur.history.1_version=version
|
||||||
aur.history.2_release=release
|
aur.history.2_release=release
|
||||||
aur.history.3_date=date
|
aur.history.3_date=date
|
||||||
|
category.orphan=orphan
|
||||||
gem.arch.info=Software packages available for distributions based on Arch Linux
|
gem.arch.info=Software packages available for distributions based on Arch Linux
|
||||||
gem.arch.label=Arch
|
gem.arch.label=Arch
|
||||||
gem.arch.type.arch_repo.label=Arch - Repository
|
gem.arch.type.arch_repo.label=Arch - Repository
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ arch_repo.history.3_date=fecha
|
|||||||
aur.history.1_version=versión
|
aur.history.1_version=versión
|
||||||
aur.history.2_release=lanzamiento
|
aur.history.2_release=lanzamiento
|
||||||
aur.history.3_date=fecha
|
aur.history.3_date=fecha
|
||||||
|
category.orphan=huérfano
|
||||||
gem.arch.info=Paquetes de software disponibles para distribuciones basadas en Arch Linux
|
gem.arch.info=Paquetes de software disponibles para distribuciones basadas en Arch Linux
|
||||||
gem.arch.label=Arch
|
gem.arch.label=Arch
|
||||||
gem.arch.type.arch_repo.label=Arch - Repositorio
|
gem.arch.type.arch_repo.label=Arch - Repositorio
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ arch_repo.history.3_date=date
|
|||||||
aur.history.1_version=version
|
aur.history.1_version=version
|
||||||
aur.history.2_release=livraison
|
aur.history.2_release=livraison
|
||||||
aur.history.3_date=date
|
aur.history.3_date=date
|
||||||
|
category.orphan=orphan
|
||||||
gem.arch.info=Paquets logiciels disponibles pour les distributions basées sur Arch Linux
|
gem.arch.info=Paquets logiciels disponibles pour les distributions basées sur Arch Linux
|
||||||
gem.arch.label=Arch
|
gem.arch.label=Arch
|
||||||
gem.arch.type.arch_repo.label=Arch - Dépôt
|
gem.arch.type.arch_repo.label=Arch - Dépôt
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ arch_repo.history.3_date=data
|
|||||||
aur.history.1_version=versione
|
aur.history.1_version=versione
|
||||||
aur.history.2_release=rilascio
|
aur.history.2_release=rilascio
|
||||||
aur.history.3_date=data
|
aur.history.3_date=data
|
||||||
|
category.orphan=orphan
|
||||||
gem.arch.info=Software packages available for distributions based on Arch Linux
|
gem.arch.info=Software packages available for distributions based on Arch Linux
|
||||||
gem.arch.label=Arch
|
gem.arch.label=Arch
|
||||||
gem.arch.type.arch_repo.label=Arch - Deposito
|
gem.arch.type.arch_repo.label=Arch - Deposito
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ arch_repo.history.3_date=data
|
|||||||
aur.history.1_version=versão
|
aur.history.1_version=versão
|
||||||
aur.history.2_release=lançamento
|
aur.history.2_release=lançamento
|
||||||
aur.history.3_date=data
|
aur.history.3_date=data
|
||||||
|
category.orphan=órfão
|
||||||
gem.arch.info=Pacotes de software disponíveis para distribuições baseadas em Arch Linux
|
gem.arch.info=Pacotes de software disponíveis para distribuições baseadas em Arch Linux
|
||||||
gem.arch.label=Arch
|
gem.arch.label=Arch
|
||||||
gem.arch.type.arch_repo.label=Arch - Repositório
|
gem.arch.type.arch_repo.label=Arch - Repositório
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ arch_repo.history.3_date=date
|
|||||||
aur.history.1_version=Версия
|
aur.history.1_version=Версия
|
||||||
aur.history.2_release=Выпуск
|
aur.history.2_release=Выпуск
|
||||||
aur.history.3_date=Дата
|
aur.history.3_date=Дата
|
||||||
|
category.orphan=orphan
|
||||||
gem.arch.info=Пакеты программного обеспечения, доступные для дистрибутивов на базе Arch Linux
|
gem.arch.info=Пакеты программного обеспечения, доступные для дистрибутивов на базе Arch Linux
|
||||||
gem.arch.label=Arch
|
gem.arch.label=Arch
|
||||||
gem.arch.type.arch_repo.label=Arch - Repository
|
gem.arch.type.arch_repo.label=Arch - Repository
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ arch_repo.history.3_date=tarih
|
|||||||
aur.history.1_version=sürüm
|
aur.history.1_version=sürüm
|
||||||
aur.history.2_release=sürüm inşa
|
aur.history.2_release=sürüm inşa
|
||||||
aur.history.3_date=tarih
|
aur.history.3_date=tarih
|
||||||
|
category.orphan=orphan
|
||||||
gem.arch.info=Arch Linux tabanlı dağıtımlar için mevcut yazılım paketleri
|
gem.arch.info=Arch Linux tabanlı dağıtımlar için mevcut yazılım paketleri
|
||||||
gem.arch.label=Arch
|
gem.arch.label=Arch
|
||||||
gem.arch.type.arch_repo.label=Arch - Depoları
|
gem.arch.type.arch_repo.label=Arch - Depoları
|
||||||
|
|||||||
Reference in New Issue
Block a user