portage.package.ebuild._config.VirtualsManager module

class portage.package.ebuild._config.VirtualsManager.VirtualsManager(*args, **kwargs)

Bases: object


Stack installed and profile virtuals. Preference for virtuals decreases from left to right. Order of preference: 1. installed and in profile 2. installed only 3. profile only


Initialize _treeVirtuals from the given vartree. It must not have been initialized already, otherwise our assumptions about immutability don’t hold.


Read the ‘virtuals’ file in all profiles.

add_depgraph_virtuals(mycpv, virts)

This updates the preferences for old-style virtuals, affecting the behavior of dep_expand() and dep_check() calls. It can change dbapi.match() behavior since that calls dep_expand(). However, dbapi instances have internal match caches that are not invalidated when preferences are updated here. This can potentially lead to some inconsistency (relevant to bug #1343).


Computes self._virtuals if necessary and returns it. self._virtuals is only computed on the first call.


Initialize _treeVirtuals if it hasn’t been done already. This is a hack for consumers that already have an populated vartree.