_emerge.BlockerCache module

class _emerge.BlockerCache.BlockerCache(myroot, vardb)

Bases: portage.cache.mappings.MutableMapping

This caches blockers of installed packages so that dep_check does not have to be done for every single installed package on every invocation of emerge. The cache is invalidated whenever it is detected that something has changed that might alter the results of dep_check() calls:

  1. the set of installed packages (including COUNTER) has changed

class BlockerData(counter, atoms)

Bases: object

atoms
counter
_cache_threshold = 5
_load()
clear()
flush()

If the current user has permission and the internal blocker cache has been updated, save it to disk and mark it unmodified. This is called by emerge after it has processed blockers for all installed packages. Currently, the cache is only written if the user has superuser privileges (since that’s required to obtain a lock), but all users have read access and benefit from faster blocker lookups (as long as the entire cache is still valid). The cache is stored as a pickled dict object with the following format:

{

version : “1”, “blockers” : {cpv1:(counter,(atom1, atom2…)), cpv2…},

}

get(key, default=None)
items()
iteritems()
iterkeys()
itervalues()
keys()
pop(key, *args)
popitem()
setdefault(key, default=None)
update(*args, **kwargs)
values()