_emerge.depgraph module

_emerge.depgraph._backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, spinner)
class _emerge.depgraph._dep_check_composite_db(depgraph, root)

Bases: portage.dbapi.dbapi

A dbapi-like interface that is optimized for use in dep_check() calls. This is built on top of the existing depgraph package selection logic. Some packages that have been added to the graph may be masked from this view in order to influence the atom preference selection that occurs via dep_check().

_categories = None
_category_re = re.compile('^\\w[-.+\\w]*$')
_clear_cache()
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.

_have_virt_update(pkg, atom_set)
_iter_match(atom, cpv_iter)
_iter_match_repo(atom, cpv_iter)
_iter_match_slot(atom, cpv_iter)
_iter_match_use(atom, cpv_iter)
  1. Check for required IUSE intersection (need implicit IUSE here).

  2. Check enabled/disabled flag states.

_iter_virt_update(pkg, atom_set)
_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.

Parameters
Returns

a callable that accepts a single USE flag argument, and returns True only if the USE flag should be considered to be a member of the implicit IUSE for the given package.

Return type

callable

_known_keys = frozenset({'BDEPEND', 'DEFINED_PHASES', 'DEPEND', 'DESCRIPTION', 'EAPI', 'HOMEPAGE', 'IDEPEND', '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')
_repoman_iuse_implicit_cnstr(pkg, metadata)

In repoman’s version of _iuse_implicit_cnstr, account for modifications of the self.settings reference between calls.

_use_mutable = False
_visible(pkg, atom_set, avoid_slot_conflict=True, probe_virt_update=True)
aux_get(cpv, wants)

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)

Emulate cp_list just so it can be used to check for existence of new-style virtuals. Since it’s a waste of time to return more than one cpv for this use case, a maximum of one cpv will be returned.

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(atom)

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

match_pkgs(atom)
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.

class _emerge.depgraph._dep_check_graph_interface(will_replace_child, removal_action, want_update_pkg)

Bases: tuple

_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('will_replace_child', 'removal_action', 'want_update_pkg')
classmethod _make(iterable)

Make a new _dep_check_graph_interface object from a sequence or iterable

_replace(**kwds)

Return a new _dep_check_graph_interface object replacing specified fields with new values

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

removal_action

Alias for field number 1

want_update_pkg

Alias for field number 2

will_replace_child

Alias for field number 0

class _emerge.depgraph._depgraph_sets

Bases: object

class _emerge.depgraph._dynamic_depgraph_config(depgraph, myparams, allow_backtracking, backtrack_parameters)

Bases: object

dynamic_depgraph_config is an object that is used to collect settings and important data structures that are used in calculating Portage dependencies. Each depgraph created by the depgraph.py code gets its own dynamic_depgraph_config, whereas frozen_depgraph_config is shared among all depgraphs.

self.digraph

Of particular importance is the instance variable self.digraph, which is an instance of portage.util.digraph, a directed graph data structure. portage.util.digraph is used for a variety of purposes in the Portage codebase, but in this particular scenario as self.digraph, it is used to create a dependency tree of Portage packages. So for self.digraph, each node of the directed graph is a Package, while edges connect nodes and each edge can have a Priority. The Priority setting is used to help resolve circular dependencies, and should be interpreted in the direction of parent to child.

Conceptually, think of self.digraph as containing user-specified packages or sets at the very top, with dependencies hanging down as children, and dependencies of those children as children of children, etc. The depgraph is intended to model dependency relationships, not the order that packages should be installed.

resolving the digraph

To convert a digraph to an ordered list of packages to merge in an order where all dependencies are properly satisfied, we would first start by looking at leaf nodes, which are nodes that have no dependencies of their own. We could then traverse the digraph upwards from the leaf nodes, towards the parents. Along the way, depending on emerge options, we could make decisions what packages should be installed or rebuilt. This is how self.digraph is used in the code.

digraph creation

The depgraph.py code creates the digraph by first adding emerge arguments to the digraph as the main parents, so if @world is specified, then the world set is added as the main parents. Then, emerge will determine the dependencies of these packages, and depending on what options are passed to emerge, will look at installed packages, binary packages and available ebuilds that could be merged to satisfy dependencies, and these will be added as children in the digraph. Children of children will be added as dependencies as needed, depending on the depth setting used by emerge.

As the digraph is created, it is perfectly fine for Packages to be added to the digraph that conflict with one another. After the digraph has been fully populated to the necessary depth, code within depgraph.py will identify any conflicts that are modeled within the digraph and determine the best way to handle them.

class _emerge.depgraph._frozen_depgraph_config(settings, trees, myopts, params, spinner)

Bases: object

_emerge.depgraph._get_masking_status(pkg, pkgsettings, root_config, myrepo=None, use=None)
class _emerge.depgraph._rebuild_config(frozen_config, backtrack_parameters)

Bases: object

_needs_rebuild(dep_pkg)

Check whether packages that depend on dep_pkg need to be rebuilt.

_trigger_rebuild(parent, build_deps)
add(dep_pkg, dep)
trigger_rebuilds()

Trigger rebuilds where necessary. If pkgA has been updated, and pkgB depends on pkgA at both build-time and run-time, pkgB needs to be rebuilt.

_emerge.depgraph._resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner)

Construct a depgraph for the given resume list. This will raise PackageNotFound or depgraph.UnsatisfiedResumeDep when necessary. TODO: Return reasons for dropped_tasks, for display/logging. :rtype: tuple :return: (success, depgraph, dropped_tasks)

class _emerge.depgraph._scheduler_graph_config(trees, pkg_cache, graph, mergelist)

Bases: object

_emerge.depgraph._spinner_start(spinner, myopts)
_emerge.depgraph._spinner_stop(spinner)
class _emerge.depgraph._use_changes(new_use, new_changes, required_use_satisfied=True)

Bases: tuple

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

_emerge.depgraph._wildcard_set(atoms)
_emerge.depgraph.ambiguous_package_name(arg, atoms, root_config, spinner, myopts)
_emerge.depgraph.backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, spinner)

Raises PackageSetNotFound if myfiles contains a missing package set.

class _emerge.depgraph.depgraph(settings, trees, myopts, myparams, spinner, frozen_config=None, backtrack_parameters=<_emerge.resolver.backtracking.BacktrackParameter object>, allow_backtracking=False)

Bases: object

exception UnsatisfiedResumeDep(depgraph, value)

Bases: portage.exception.PortageException

A dependency of a resume list is not installed. This can occur when a required package is dropped from the merge list via –skipfirst.

args
with_traceback()

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

class _AutounmaskLevel

Bases: object

allow_license_changes
allow_missing_keywords
allow_unmasks
allow_unstable_keywords
allow_use_changes
_UNREACHABLE_DEPTH = <object object>
_accept_blocker_conflicts()
_add_dep(dep, allow_unsatisfied=False)
_add_installed_sonames(pkg)
_add_parent_atom(pkg, parent_atom)
_add_pkg(pkg, dep)

Adds a package to the depgraph, queues dependencies, and handles slot conflicts.

_add_pkg_dep_string(pkg, dep_root, dep_priority, dep_string, allow_unsatisfied)
_add_pkg_deps(pkg, allow_unsatisfied=False)
_add_pkg_soname_deps(pkg, allow_unsatisfied=False)
_add_slot_operator_dep(dep)
_apply_autounmask_continue_state()

Apply autounmask changes to Package instances, so that their state will be consistent configuration file changes.

_apply_parent_use_changes()

For parents with unsatisfied conditional dependencies, translate USE change suggestions into autounmask changes.

exception _autounmask_breakage(value='')

Bases: _emerge.depgraph.depgraph._internal_exception

This is raised by _show_unsatisfied_dep() when it’s called with check_autounmask_breakage=True and a matching package has been been disqualified due to autounmask changes.

args
with_traceback()

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

_autounmask_levels()

Iterate over the different allowed things to unmask.

  1. USE

  2. USE + license

  3. USE + ~arch + license

  4. USE + ~arch + license + missing keywords

  5. USE + license + masks

  6. USE + ~arch + license + masks

  7. USE + ~arch + license + missing keywords + masks

Some thoughts:
  • Do least invasive changes first.

  • Try unmasking alone before unmasking + missing keywords

    to avoid -9999 versions if possible

exception _backtrack_mask(value='')

Bases: _emerge.depgraph.depgraph._internal_exception

This is raised by _show_unsatisfied_dep() when it’s called with check_backtrack=True and a matching package has been masked by backtracking.

args
with_traceback()

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

_changed_deps(pkg)
_changed_deps_report()

Report ebuilds for which the ebuild dependencies have changed since the installed instance was built. This is completely silent in the following cases:

  • –changed-deps or –dynamic-deps is enabled

  • none of the packages with changed deps are in the graph

_changed_slot(pkg)
_check_masks(pkg)
_check_slot_conflict(pkg, atom)
_complete_graph(required_sets=None)

Add any deep dependencies of required sets (args, system, world) that have not been pulled into the graph yet. This ensures that the graph is consistent such that initially satisfied deep dependencies are not broken in the new graph. Initially unsatisfied dependencies are irrelevant since we only want to avoid breaking dependencies that are initially satisfied.

Since this method can consume enough time to disturb users, it is currently only enabled by the –complete-graph option.

Parameters

required_sets (dict) – contains required sets (currently only used for depclean and prune removal operations)

_compute_abi_rebuild_info()

Fill self._forced_rebuilds with packages that cause rebuilds.

_create_graph(allow_unsatisfied=False)
_dep_expand(root_config, atom_without_category)
Parameters
  • root_config (RootConfig) – a root config instance

  • atom_without_category (String) – an atom without a category component

Return type

list

Returns

a list of atoms containing categories (possibly empty)

_depth_increment(depth, n=1)

Return depth + n if depth is an int, otherwise return depth.

Parameters
  • depth (int or _UNREACHABLE_DEPTH) – the depth of a particular package

  • n (int) – number to add (default is 1)

Return type

int or _UNREACHABLE_DEPTH

Returns

depth + 1 or _UNREACHABLE_DEPTH

_display_autounmask(autounmask_continue=False)

Display –autounmask message and optionally write it to config files (using CONFIG_PROTECT). The message includes the comments and the changes.

_downgrade_probe(pkg)

Detect cases where a downgrade of the given package is considered desirable due to the current version being masked or unavailable.

_dynamic_deps_preload(fake_vartree)
class _dynamic_deps_proc_exit(pkg, fake_vartree)

Bases: object

_fake_vartree
_pkg
_eliminate_ignored_binaries()

Eliminate any package from self._dynamic_config.ignored_binaries for which a more optimal alternative exists.

_equiv_binary_installed(pkg)
_equiv_ebuild(pkg)
_equiv_ebuild_visible(pkg, autounmask_level=None)
_expand_set_args(input_args, add_to_digraph=False)

Iterate over a list of DependencyArg instances and yield all instances given in the input together with additional SetArg instances that are generated from nested sets. :param input_args: An iterable of DependencyArg instances :type input_args: Iterable :param add_to_digraph: If True then add SetArg instances

to the digraph, in order to record parent -> child relationships from nested sets

Return type

Iterable

Returns

All args given in the input together with additional SetArg instances that are generated from nested sets

_expand_virt_from_graph(root, atom)
_flatten_atoms(pkg, use)

Evaluate all dependency atoms of the given package, and return them as a frozenset. For performance, results are cached.

Parameters
  • pkg (frozenset) – a Package instance

  • pkg – set of enabled USE flags

Return type

frozenset

Returns

set of evaluated atoms

_gen_reinstall_sets()
_get_dep_chain(start_node, target_atom=None, unsatisfied_dependency=False)

Returns a list of (atom, node_type) pairs that represent a dep chain. If target_atom is None, the first package shown is pkg’s parent. If target_atom is not None the first package shown is pkg. If unsatisfied_dependency is True, the first parent is select who’s dependency is not satisfied by ‘pkg’. This is need for USE changes. (Does not support target_atom.)

_get_dep_chain_as_comment(pkg, unsatisfied_dependency=False)
_get_missed_updates()
_greedy_slots(root_config, atom, blocker_lookahead=False)

Return a list of slot atoms corresponding to installed slots that differ from the slot of the highest visible match. When blocker_lookahead is True, slot atoms that would trigger a blocker conflict are automatically discarded, potentially allowing automatic uninstallation of older slots when appropriate.

_have_autounmask_changes()
_have_new_virt(root, atom_cp)
_ignore_dependency(atom, pkg, child, dep, mypriority, recurse_satisfied)

In some cases, dep_check will return deps that shouldn’t be processed any further, so they are identified and discarded here. Try to discard as few as possible since discarded dependencies reduce the amount of information available for optimization of merge order. Don’t ignore dependencies if pkg has a slot operator dependency on the child and the child has changed slot/sub_slot.

_ignored_binaries_autounmask_backtrack()

Check if there are ignored binaries that would have been accepted with the current autounmask USE changes.

Return type

bool

Returns

True if there are unnecessary rebuilds that can be avoided by backtracking

_implicit_libc_deps(mergelist, graph)

Create implicit dependencies on libc, in order to ensure that libc is installed as early as possible (see bug #303567).

_in_blocker_conflict(pkg)

Check if pkg is involved in a blocker conflict. This method only works after the _validate_blockers method has been called.

_index_binpkgs()
exception _internal_exception(value='')

Bases: portage.exception.PortageException

args
with_traceback()

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

_is_argument(pkg)
_iter_atoms_for_pkg(pkg)
_iter_match_pkgs(root_config, pkg_type, atom, onlydeps=False)
_iter_match_pkgs_any(root_config, atom, onlydeps=False)
_iter_match_pkgs_atom(root_config, pkg_type, atom, onlydeps=False)

Iterate over Package instances of pkg_type matching the given atom. This does not check visibility and it also does not match USE for unbuilt ebuilds since USE are lazily calculated after visibility checks (to avoid the expense when possible).

_iter_match_pkgs_soname(root_config, pkg_type, atom, onlydeps=False)
_iter_similar_available(graph_pkg, atom, autounmask_level=None)

Given a package that’s in the graph, do a rough check to see if a similar package is available to install. The given graph_pkg itself may be yielded only if it’s not installed.

_loadResumeCommand(resume_data, skip_masked=True, skip_missing=True)

Add a resume command to the graph and validate it in the process. This will raise a PackageNotFound exception if a package is not available.

_load_favorites(favorites)

Use a list of favorites to resume state from a previous select_files() call. This creates similar DependencyArg instances to those that would have been created by the original select_files() call. This allows Package instances to be matched with DependencyArg instances during graph creation.

_load_vdb()

Load installed package metadata if appropriate. This used to be called from the constructor, but that wasn’t very nice since this procedure is slow and it generates spinner output. So, now it’s called on-demand by various methods when necessary.

_merge_order_bias(mygraph)

For optimal leaf node selection, promote deep system runtime deps and order nodes from highest to lowest overall reference count.

_minimize_children(parent, priority, root_config, atoms)

Selects packages to satisfy the given atoms, and minimizes the number of selected packages. This serves to identify and eliminate redundant package selections when multiple atoms happen to specify a version range.

_pkg(cpv, type_name, root_config, installed=False, onlydeps=False, myrepo=None)

Get a package instance from the cache, or create a new one if necessary. Raises PackageNotFound from aux_get if it failures for some reason (package does not exist or is corrupt).

_pkg_use_enabled(pkg, target_use=None)

If target_use is None, returns pkg.use.enabled + changes in _needed_use_config_changes. If target_use is given, the need changes are computed to make the package useable. Example: target_use = { “foo”: True, “bar”: False } The flags target_use must be in the pkg’s IUSE. :rtype: frozenset :return: set of effectively enabled USE flags, including changes

made by autounmask

_pkg_visibility_check(pkg, autounmask_level=None, trust_graph=True)
_pop_disjunction(allow_unsatisfied)

Pop one disjunctive dep from self._dynamic_config._dep_disjunctive_stack, and use it to populate self._dynamic_config._dep_stack.

_priority(**kwargs)
_process_slot_conflict(conflict)

Process slot conflict data to identify specific atoms which lead to conflict. These atoms only match a subset of the packages that have been pulled into a given slot.

_process_slot_conflicts()

If there are any slot conflicts and backtracking is enabled, _complete_graph should complete the graph before this method is called, so that all relevant reverse dependencies are available for use in backtracking decisions.

_prune_highest_pkg_cache(pkg)
_queue_disjunction(pkg, dep_root, dep_priority, dep_struct)
_queue_disjunctive_deps(pkg, dep_root, dep_priority, dep_struct, _disjunctions_recursive=None)

Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack. Yields non-disjunctive deps. Raises InvalidDependString when necessary.

_reinstall_for_flags(pkg, forced_flags, orig_use, orig_iuse, cur_use, cur_iuse)

Return a set of flags that trigger reinstallation, or None if there are no such flags.

_remove_pkg(pkg)

Remove a package and all its then parentless digraph children from all depgraph datastructures.

_replace_installed_atom(inst_pkg)

Given an installed package, generate an atom suitable for slot_operator_replace_installed backtracking info. The replacement SLOT may differ from the installed SLOT, so first search by cpv.

_resolve(myfavorites)

Given self._dynamic_config._initial_arg_list, pull in the root nodes, call self._creategraph to process theier deps and return a favorite list.

_resolve_conflicts()
_select_atoms_from_graph(*pargs, **kwargs)

Prefer atoms matching packages that have already been added to the graph or those that are installed and have not been scheduled for replacement.

_select_atoms_highest_available(root, depstring, myuse=None, parent=None, strict=True, trees=None, priority=None)

This will raise InvalidDependString if necessary. If trees is None then self._dynamic_config._filtered_trees is used.

_select_atoms_probe(root, pkg)
_select_files(myfiles)

Given a list of .tbz2s, .ebuilds sets, and deps, populate self._dynamic_config._initial_arg_list and call self._resolve to create the appropriate depgraph and return a favorite list.

_select_pkg_from_graph(root, atom, onlydeps=False, parent=None)

Select packages that have already been added to the graph or those that are installed and have not been scheduled for replacement.

_select_pkg_from_installed(root, atom, onlydeps=False, parent=None)

Select packages that are installed.

_select_pkg_highest_available(root, atom, onlydeps=False, parent=None)
_select_pkg_highest_available_imp(root, atom, onlydeps=False, parent=None)
_serialize_tasks()
exception _serialize_tasks_retry(value='')

Bases: _emerge.depgraph.depgraph._internal_exception

This is raised by the _serialize_tasks() method when it needs to be called again for some reason. The only case that it’s currently used for is when neglected dependencies need to be added to the graph in order to avoid making a potentially unsafe decision.

args
with_traceback()

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

_set_args(args)

Create the “__non_set_args__” package set from atoms and packages given as arguments. This method can be called multiple times if necessary. The package selection cache is automatically invalidated, since arguments influence package selections.

_show_abi_rebuild_info()
_show_circular_deps(mygraph)
_show_ignored_binaries()

Show binaries that have been ignored because their USE didn’t match the user’s config.

_show_ignored_binaries_changed_deps(changed_deps)
_show_ignored_binaries_respect_use(respect_use)
_show_merge_list()
_show_missed_update()
_show_missed_update_slot_conflicts(missed_updates)
_show_missed_update_unsatisfied_dep(missed_updates)
_show_slot_collision_notice()

Show an informational message advising the user to mask one of the the packages. In some cases it may be possible to resolve this automatically, but support for backtracking (removal nodes that have already been selected) will be required in order to handle all possible cases.

_show_unsatisfied_blockers(blockers)
_show_unsatisfied_dep(root, atom, myparent=None, arg=None, check_backtrack=False, check_autounmask_breakage=False, show_req_use=None, collect_use_changes=False)

When check_backtrack=True, no output is produced and the method either returns or raises _backtrack_mask if a matching package has been masked by backtracking.

_slot_change_backtrack(dep, new_child_slot)
_slot_change_probe(dep)
Return type

bool

Returns

True if dep.child should be rebuilt due to a change in sub-slot (without revbump, as in bug #456208).

_slot_confict_backtrack(root, slot_atom, all_parents, conflict_pkgs)
_slot_conflict_backtrack_abi(pkg, slot_nodes, conflict_atoms)

If one or more conflict atoms have a slot/sub-slot dep that can be resolved by rebuilding the parent package, then schedule the rebuild via backtracking, and return True. Otherwise, return False.

_slot_operator_trigger_reinstalls()

Search for packages with slot-operator deps on older slots, and schedule rebuilds if they can link to a newer slot that’s in the graph.

_slot_operator_unsatisfied_backtrack(dep)
_slot_operator_unsatisfied_probe(dep)
_slot_operator_update_backtrack(dep, new_child_slot=None, new_dep=None)
_slot_operator_update_probe(dep, new_child_slot=False, slot_conflict=False, autounmask_level=None)

slot/sub-slot := operators tend to prevent updates from getting pulled in, since installed packages pull in packages with the slot/sub-slot that they were built against. Detect this case so that we can schedule rebuilds and reinstalls when appropriate. NOTE: This function only searches for updates that involve upgrades

to higher versions, since the logic required to detect when a downgrade would be desirable is not implemented.

_slot_operator_update_probe_slot_conflict(dep)
_solve_non_slot_operator_slot_conflicts()

This function solves slot conflicts which can be solved by simply choosing one of the conflicting and removing all the other ones. It is able to solve somewhat more complex cases where conflicts can only be solved simultaniously.

_spinner_update()
_too_deep(depth)

Check if a package depth is deeper than the max allowed depth.

Parameters

depth (int or _UNREACHABLE_DEPTH) – the depth of a particular package

Return type

bool

Returns

True if the package is deeper than the max allowed depth

exception _unknown_internal_error(value='')

Bases: _emerge.depgraph.depgraph._internal_exception

Used by the depgraph internally to terminate graph creation. The specific reason for the failure should have been dumped to stderr, unfortunately, the exact reason for the failure may not be known.

args
with_traceback()

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

_upgrade_available(pkg)

Detect cases where an upgrade of the given package is available within the same slot.

_validate_blockers()

Remove any blockers from the digraph that do not match any of the packages within the graph. If necessary, create hard deps to ensure correct merge order such that mutually blocking packages are never installed simultaneously. Also add runtime blockers from all installed packages if any of them haven’t been added already (bug 128809).

Normally, this method is called only after the graph is complete, and after _solve_non_slot_operator_slot_conflicts has had an opportunity to solve slot conflicts (possibly removing some blockers). It can also be called earlier, in order to get a preview of the blocker data, but then it needs to be called again after the graph is complete.

_virt_deps_visible(pkg, ignore_use=False)

Assumes pkg is a virtual package. Traverses virtual deps recursively and returns True if all deps are visible, False otherwise. This is useful for checking if it will be necessary to expand virtual slots, for cases like bug #382557.

_want_installed_pkg(pkg)

Given an installed package returned from select_pkg, return True if the user has not explicitly requested for this package to be replaced (typically via an atom on the command line).

_want_update_pkg(parent, pkg)
_will_replace_child(parent, root, atom)

Check if a given parent package will replace a child package for the given root and atom.

Parameters
  • parent (Package) – parent package

  • root (str) – child root

  • atom (Atom) – child atom

Return type

Package

Returns

child package to replace, or None

_wrapped_add_pkg_dep_string(pkg, dep_root, dep_priority, dep_string, allow_unsatisfied)
_wrapped_select_pkg_highest_available_imp(root, atom, onlydeps=False, autounmask_level=None, parent=None)
altlist(reversed=<class 'DeprecationWarning'>)
autounmask_breakage_detected()
break_refs()

Break any references in Package instances that lead back to the depgraph. This is useful if you want to hold references to packages without also holding the depgraph on the heap. It should only be called after the depgraph and _frozen_config will not be used for any more calculations.

display(mylist, favorites=[], verbosity=None)
display_problems()

Display problems with the dependency graph such as slot collisions. This is called internally by display() to show the problems _after_ the merge list where it is most likely to be seen, but if display() is not going to be called then this method should be called explicitly to ensure that the user is notified of problems with the graph.

get_backtrack_infos()
need_config_change()

Returns true if backtracking should terminate due to a needed configuration change.

need_config_reload()
need_display_problems()

Returns true if this depgraph has problems which need to be displayed to the user.

need_restart()
pkg_tree_map = {'binary': 'bintree', 'ebuild': 'porttree', 'installed': 'vartree'}
saveNomergeFavorites()

Find atoms in favorites that are not in the mergelist and add them to the world file if necessary.

schedulerGraph()

The scheduler graph is identical to the normal one except that uninstall edges are reversed in specific cases that require conflicting packages to be temporarily installed simultaneously. This is intended for use by the Scheduler in it’s parallelization logic. It ensures that temporary simultaneous installation of conflicting packages is avoided when appropriate (especially for !!atom blockers), but allowed in specific cases that require it.

Note that this method calls break_refs() which alters the state of internal Package instances such that this depgraph instance should not be used to perform any more calculations.

select_files(args)
_emerge.depgraph.get_mask_info(root_config, cpv, pkgsettings, db, pkg_type, built, installed, db_keys, myrepo=None, _pkg_use_enabled=None)
_emerge.depgraph.get_masking_status(pkg, pkgsettings, root_config, myrepo=None, use=None)
_emerge.depgraph.resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner)

Raises PackageSetNotFound if myfiles contains a missing package set.

_emerge.depgraph.show_mask_docs()
_emerge.depgraph.show_masked_packages(masked_packages)