mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 03:04:15 +02:00
[aur] caching the package categories to the disk
This commit is contained in:
@@ -47,7 +47,7 @@ def set_icon_path(app: ArchPackage, icon_name: str = None):
|
||||
break
|
||||
|
||||
|
||||
def save_several(pkgnames: Set[str], mirror: str, overwrite: bool = True, maintainer: str = None) -> int:
|
||||
def save_several(pkgnames: Set[str], mirror: str, overwrite: bool = True, maintainer: str = None, categories: dict = None) -> int:
|
||||
to_cache = {n for n in pkgnames if overwrite or not os.path.exists(ArchPackage.disk_cache_path(n, mirror))}
|
||||
desktop_files = pacman.list_desktop_entries(to_cache)
|
||||
|
||||
@@ -138,6 +138,9 @@ def save_several(pkgnames: Set[str], mirror: str, overwrite: bool = True, mainta
|
||||
|
||||
if to_write:
|
||||
for p in to_write:
|
||||
if categories:
|
||||
p.categories = categories.get(p.name)
|
||||
|
||||
p.maintainer = maintainer
|
||||
write(p)
|
||||
return len(to_write)
|
||||
|
||||
Reference in New Issue
Block a user