_emerge.FakeVartree module

class _emerge.FakeVartree.FakeVardbGetPath(vardb)

Bases: object

Implements the vardbapi.getpath() method which is used in error handling code for the Package class and vartree.get_provide().

class _emerge.FakeVartree.FakeVartree(root_config, pkg_cache=None, pkg_root_config=None, dynamic_deps=False, ignore_built_slot_operator_deps=False, soname_deps=False)

Bases: portage.dbapi.vartree.vartree

This is implements an in-memory copy of a vartree instance that provides all the interfaces required for use by the depgraph. The vardb is locked during the constructor call just long enough to read a copy of the installed package information. This allows the depgraph to do it’s dependency calculations without holding a lock on the vardb. It also allows things like vardb global updates to be done in memory so that the user doesn’t necessarily need write access to the vardb in cases where global updates are necessary (updates are performed when necessary if there is not a matching ebuild in the tree). Instances of this class are not populated until the sync() method is called.

_apply_dynamic_deps(pkg, live_metadata)
_aux_get_wrapper(cpv, wants, myrepo=None)
_match_wrapper(cpv, use_cache=1)

Make sure the metadata in Package instances gets updated for any cpv that is returned from a match() call, since the metadata can be accessed directly from the Package instance instead of via aux_get().

_pkg(cpv)

The RootConfig instance that will become the Package.root_config attribute can be overridden by the FakeVartree pkg_root_config constructory argument, since we want to be consistent with the depgraph._pkg() method which uses a specially optimized RootConfig that has a FakeVartree instead of a real vartree.

_sync()
cpv_discard(pkg)

Discard a package from the fake vardb if it exists.

dep_bestmatch(mydep, use_cache=1)

compatibility method – all matches, not just visible ones

dep_match(mydep, use_cache=1)

compatibility method – we want to see all matches, not just visible ones

dynamic_deps_preload(pkg, metadata)
exists_specific(cpv)
get_all_provides()
get_provide(mycpv)
getallcpv()

temporary function, probably to be renamed — Gets a list of all category/package-versions installed on the system.

getallnodes()

new behavior: these are all unmasked nodes. There may or may not be available masked package for nodes in this nodes list.

getebuildpath(fullpackage)
getpath(mykey, filename=None)
getslot(mycatpkg)

Get a slot for a catpkg; assume it exists.

inject(mycpv)
populate()
property root
sync(acquire_lock=1)

Call this method to synchronize state with the real vardb after one or more packages may have been installed or uninstalled.

zap(mycpv)
exception _emerge.FakeVartree._DynamicDepsNotApplicable

Bases: Exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

_emerge.FakeVartree.grab_global_updates(portdb)
_emerge.FakeVartree.perform_global_updates(mycpv, aux_dict, mydb, myupdates)