portage.dbapi package¶
Submodules¶
- portage.dbapi.DummyTree module
- portage.dbapi.IndexedPortdb module
- portage.dbapi.IndexedVardb module
- portage.dbapi._ContentsCaseSensitivityManager module
- portage.dbapi._MergeProcess module
- portage.dbapi._SyncfsProcess module
- portage.dbapi._VdbMetadataDelta module
- portage.dbapi._expand_new_virt module
- portage.dbapi._similar_name_search module
- portage.dbapi.bintree module
- portage.dbapi.cpv_expand module
- portage.dbapi.dep_expand module
- portage.dbapi.porttree module
- portage.dbapi.vartree module
- portage.dbapi.virtual module
Module contents¶
- class portage.dbapi.dbapi¶
Bases:
object
- _categories = None¶
- _category_re = re.compile('^\\w[-.+\\w]*$')¶
- static _cmp_cpv(cpv1, cpv2)¶
- static _cpv_sort_ascending(cpv_list)¶
Use this to sort self.cp_list() results in ascending order. It sorts in place and returns None.
- _iter_match(atom, cpv_iter)¶
- _iter_match_repo(atom, cpv_iter)¶
- _iter_match_slot(atom, cpv_iter)¶
- _iter_match_use(atom, cpv_iter)¶
Check for required IUSE intersection (need implicit IUSE here).
Check enabled/disabled flag states.
- _iuse_implicit_cnstr(pkg, metadata)¶
Construct a callable that checks if a given USE flag should be considered to be a member of the implicit IUSE for the given package.
- _known_keys = frozenset({'BDEPEND', 'DEFINED_PHASES', 'DEPEND', 'DESCRIPTION', 'EAPI', 'HOMEPAGE', 'IDEPEND', 'INHERIT', 'INHERITED', 'IUSE', 'KEYWORDS', 'LICENSE', 'PDEPEND', 'PROPERTIES', 'RDEPEND', 'REQUIRED_USE', 'RESTRICT', 'SLOT', 'SRC_URI'})¶
- _match_use(atom, pkg, metadata, ignore_profile=False)¶
- _pkg_str(cpv, repo)¶
This is used to contruct _pkg_str instances on-demand during matching. If cpv is a _pkg_str instance with slot attribute, then simply return it. Otherwise, fetch metadata and construct a _pkg_str instance. This may raise KeyError or InvalidData.
- _pkg_str_aux_keys = ('EAPI', 'KEYWORDS', 'SLOT', 'repository')¶
- _use_mutable = False¶
- aux_get(mycpv, mylist, myrepo=None)¶
Return the metadata keys in mylist for mycpv Args:
mycpv - “sys-apps/foo-1.0” mylist - [“SLOT”,”DEPEND”,”HOMEPAGE”] myrepo - The repository name.
- Returns:
a list of results, in order of keys in mylist, such as: [“0”,”>=sys-libs/bar-1.0”,”http://www.foo.com”] or [] if mycpv not found’
- aux_update(cpv, metadata_updates)¶
- Args:
- cpv - “sys-apps/foo-1.0”
metadata_updates = { key : newvalue }
- Returns:
None
- property categories¶
Use self.cp_all() to generate a category list. Mutable instances can delete the self._categories attribute in cases when the cached categories become invalid and need to be regenerated.
- close_caches()¶
- cp_all(sort=False)¶
Implement this in a child class Args
sort - return sorted results
- Returns:
A list of strings 1 per CP in the datastore
- cp_list(cp, use_cache=1)¶
- cpv_all()¶
Return all CPVs in the db Args:
None
- Returns:
A list of Strings, 1 per CPV
This function relies on a subclass implementing cp_all, this is why the hasattr is there
- invalidentry(mypath)¶
- match(origdep, use_cache=1)¶
Given a dependency, try to find packages that match Args:
origdep - Depend atom use_cache - Boolean indicating if we should use the cache or not NOTE: Do we ever not want the cache?
- Returns:
a list of packages that match origdep
- move_slot_ent(mylist, repo_match=None)¶
This function takes a sequence: Args:
mylist: a sequence of (atom, originalslot, newslot) repo_match: callable that takes single repo_name argument
and returns True if the update should be applied
- Returns:
The number of slotmoves this function did
- update_ents(updates, onProgress=None, onUpdate=None)¶
Update metadata of all packages for package moves. :param updates: A list of move commands, or dict of {repo_name: list} :type updates: list or dict :param onProgress: A progress callback function :type onProgress: a callable that takes 2 integer arguments: maxval and curval :param onUpdate: A progress callback function called only
for packages that are modified by updates.