[aur] caching the package categories to the disk

This commit is contained in:
Vinicius Moreira
2019-10-22 17:24:39 -03:00
parent 64e4822b2d
commit 5df45627ee
4 changed files with 8 additions and 5 deletions

View File

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