pkgcore.ebuild.conditionals module

DepSet parsing.

Turns a DepSet (depend, rdepend, SRC_URI, license, etc) into appropriate conditionals.

class pkgcore.ebuild.conditionals.DepSet(*a, **kw)[source]

Bases: AndRestriction

Gentoo DepSet syntax parser

element_class
evaluate_depset(cond_dict, tristate_filter=None, pkg=None)[source]
Parameters:
  • cond_dict – container to be used for conditional collapsing, typically is a use list

  • tristate_filter – a control; if specified, must be a container of conditionals to lock to cond_dict. during processing, if it’s not in tristate_filter will automatically enable the payload (regardless of the conditionals negation)

static find_cond_nodes(restriction_set, yield_non_conditionals=False)[source]
force_False(*a)
force_True(*a)
property has_conditionals
property known_conditionals
match(*a)[source]
property node_conds
classmethod parse(dep_str, element_class, operators=None, attr=None, element_func=None, transitive_use_atoms=False, allow_src_uri_file_renames=False)[source]
Parameters:
  • dep_str – string abiding by DepSet syntax

  • operators – mapping of node -> callable for special operators in DepSet syntax

  • element_func – if None, element_class is used for generating elements, else it’s used to generate elements. Mainly useful for when you need to curry a few args for instance generation, since element_class _must_ be a class

  • element_class – class of generated elements

  • attr – name of the DepSet attribute being parsed

slotdep_str(domain)[source]
pkgcore.ebuild.conditionals.stringify_boolean(node: ~pkgcore.restrictions.restriction.base, func: ~typing.Callable[[~pkgcore.restrictions.restriction.base], str] = <class 'str'>, domain=None)[source]

func is used to stringify the actual content. Useful for fetchables.