Skip to content

Commit

Permalink
fix(pikaur-static: pypyalpm: get_repo_dict): backport get_pkg_id() ke…
Browse files Browse the repository at this point in the history
…y-generator from pikaur mainline (re: #857)
  • Loading branch information
actionless committed Dec 17, 2024
1 parent 8f18e88 commit c1fc182
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pikaur_static/pypyalpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ def get_package_name_from_depend_line(depend_line: str) -> str:
return depend_line.split("=", maxsplit=1)[0]


def get_pkg_id(pkg: Package) -> str:
return f"{pkg.db.name}/{pkg.name}"


class PackageDBCommon(abc.ABC):

_repo_cache: list[PacmanPackageInfo] | None = None
Expand Down Expand Up @@ -378,7 +382,7 @@ def get_repo_dict(
) -> dict[str, PacmanPackageInfo]:
if not cls._repo_dict_cache:
cls._repo_dict_cache = {
pkg.name: pkg
get_pkg_id(pkg): pkg
for pkg in cls.get_repo_list(handle=handle)
}
return cls._repo_dict_cache
Expand Down

0 comments on commit c1fc182

Please sign in to comment.