Skip to content

Commit

Permalink
_emerge: FakeVartree: document grab_global_updates
Browse files Browse the repository at this point in the history
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed Jan 13, 2024
1 parent 66c6c98 commit 45f0c61
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion lib/_emerge/FakeVartree.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import warnings

from typing import TYPE_CHECKING

from _emerge.Package import Package
from _emerge.PackageVirtualDbapi import PackageVirtualDbapi
from _emerge.resolver.DbapiProvidesIndex import PackageDbapiProvidesIndex
Expand All @@ -17,6 +19,10 @@
from portage.update import grab_updates, parse_updates, update_dbentries
from portage.versions import _pkg_str

if TYPE_CHECKING:
from portage.dep import Atom
import portage.dbapi.porttree


class FakeVardbGetPath:
"""
Expand Down Expand Up @@ -296,7 +302,18 @@ def _pkg(self, cpv):
return pkg


def grab_global_updates(portdb):
def grab_global_updates(
portdb: portage.dbapi.porttree.portdbapi,
) -> dict[str, list[tuple[str, "Atom", "Atom"]]]:
"""
Parse the repository's updates/ directory and return
its contents.
@param portdb: Repository whose updates we are fetching
@type portdb: portdbapi
@return: Parsed updates
@rtype: dict
"""
retupdates = {}

for repo_name in portdb.getRepositories():
Expand Down

0 comments on commit 45f0c61

Please sign in to comment.