class EclassConsumerSet(VersionedInstalled): pkgcore_config_type = ConfigHint( typename='pkgset', types={ 'vdb': 'refs:repo', 'repos': 'refs:repo', 'eclasses': 'list' }, ) def __init__(self, vdb, repos, eclasses): VersionedInstalled.__init__(self, vdb) self.repos = RepositoryGroup(repos) self.eclasses = frozenset(eclasses) def __iter__(self): for atom in VersionedInstalled.__iter__(self): pkgs = self.repos.match(atom) if not pkgs: # pkg is installed but no longer in any repo, just ignore it. continue assert len( pkgs) == 1, 'I do not know what I am doing: %r' % (pkgs, ) pkg = pkgs[0] if self.eclasses.isdisjoint(pkg.data.get('_eclasses_', ())): yield atom
class EclassConsumerSet(VersionedInstalled): pkgcore_config_type = ConfigHint( typename='pkgset', types={ 'vdb': 'refs:repo', 'repos': 'refs:repo', 'eclasses': 'list'}, ) def __init__(self, vdb, repos, eclasses): VersionedInstalled.__init__(self, vdb) self.repos = RepositoryGroup(repos) self.eclasses = frozenset(eclasses) def __iter__(self): for atom in VersionedInstalled.__iter__(self): pkgs = self.repos.match(atom) if not pkgs: # pkg is installed but no longer in any repo, just ignore it. continue assert len(pkgs) == 1, 'I do not know what I am doing: %r' % (pkgs,) pkg = pkgs[0] if self.eclasses.isdisjoint(pkg.data.get('_eclasses_', ())): yield atom
def installed_repos(self): """Group of configured, installed package repos.""" repos = [] for repo in self.installed_repos_raw: try: repos.append(self._wrap_repo(repo, filtered=False)) except repo_errors.RepoError as e: logger.warning(f'skipping {repo.repo_id!r} repo: {e}') return RepositoryGroup(repos)
def source_repos_raw(self): """Group of package repos without filtering.""" repos = [] for r in self.__repos: try: repo = r.instantiate() except config_errors.InstantiationError as e: # roll back the exception chain to a meaningful error message exc = find_user_exception(e) if exc is None: exc = e logger.warning(f'skipping {r.name!r} repo: {exc}') continue if not repo.is_supported: logger.warning( f'skipping {r.name!r} repo: unsupported EAPI {str(repo.eapi)!r}') continue repos.append(repo) return RepositoryGroup(repos)
def __init__(self, vdb, repos, eclasses): VersionedInstalled.__init__(self, vdb) self.repos = RepositoryGroup(repos) self.eclasses = frozenset(eclasses)
def binary_repos_raw(self): """Group of all binary repos without filtering.""" return RepositoryGroup( x for x in self.source_repos_raw if isinstance(x, binary_repo.tree))
def binary_repos_unfiltered(self): """Group of all binary repos without package filtering.""" return RepositoryGroup( x for x in self.unfiltered_repos if isinstance(x, binary_repo.ConfiguredTree))
def binary_repos(self): """Group of all binary repos bound with configuration data.""" return RepositoryGroup( x for x in self.source_repos if isinstance(x.raw_repo, binary_repo.ConfiguredTree))
def ebuild_repos_raw(self): """Group of all ebuild repos without filtering.""" return RepositoryGroup( x for x in self.source_repos_raw if isinstance(x, ebuild_repo.UnconfiguredTree))
def repos(self): """Group of all repos.""" return RepositoryGroup( chain(self.source_repos, self.installed_repos))
def unfiltered_repos(self): """Group of all configured repos without filtering.""" repos = chain(self.source_repos, self.installed_repos) return RepositoryGroup( (r.raw_repo if r.raw_repo is not None else r) for r in repos)
def repos_raw(self): """Group of all repos without filtering.""" return RepositoryGroup( chain(self.source_repos_raw, self.installed_repos_raw))
def installed_repos_raw(self): """Group of installed repos without filtering.""" repos = [r.instantiate() for r in self.__vdb] if self.profile.provides_repo is not None: repos.append(self.profile.provides_repo) return RepositoryGroup(repos)