Package entropy :: Package client :: Package interfaces :: Module dep :: Class CalculatorsMixin

Class CalculatorsMixin

source code


Instance Methods
 
dependencies_test(self, *args, **kwargs) source code
 
atom_match(self, atom, match_slot=None, mask_filter=True, multi_match=False, multi_repo=False, match_repo=None, extended_results=False, use_cache=True)
Match one or more packages inside all the available repositories.
source code
 
atom_search(self, keyword, description=False, repositories=None, use_cache=True)
Search packages inside all the available repositories, including the installed packages one.
source code
list
packages_expand(self, packages)
Given a list of user requested packages, expands it resolving for instance, items such as package sets.
source code
list
calculate_masked_packages(self, *args, **kwargs)
Compute a list of masked packages.
source code
list
calculate_available_packages(self, *args, **kwargs)
Compute a list of available packages in repositories.
source code
 
calculate_critical_updates(self, *args, **kwargs) source code
list
calculate_security_updates(self, *args, **kwargs)
Return a list of security updates available using Entropy Security interface and Client.calculate_updates().
source code
tuple
calculate_updates(self, *args, **kwargs)
Calculate package updates.
source code
tuple
calculate_orphaned_packages(self, *args, **kwargs)
Collect Installed Packages that are no longer available in Entropy repositories due to their support being discontinued.
source code
 
check_package_update(self, *args, **kwargs) source code
bool
validate_package_removal(self, *args, **kwargs)
Determine whether given package identifier is allowed to be removed.
source code
dict
get_masked_packages(self, *args, **kwargs)
Return a list of masked packages which are dependencies of given package matches.
source code
list
get_removal_queue(self, *args, **kwargs)
Return removal queue (list of installed packages identifiers).
source code
list
get_reverse_queue(self, *args, **kwargs)
Return a list of reverse dependecies for given package matches.
source code
 
get_install_queue(self, *args, **kwargs)
Return the ordered installation queue (including dependencies, if required), for given package matches.
source code
Class Variables
  DISABLE_SLOT_INTERSECTION = None
hash(x)
  DISABLE_REWRITE_SELECTED_MATCHES = None
hash(x)
  DISABLE_AUTOCONFLICT = None
hash(x)
  DISABLE_ASAP_SCHEDULING = None
hash(x)
  DISABLE_NEEDED_SCANNING = None
hash(x)
Method Details

dependencies_test(self, *args, **kwargs)

source code 
Decorators:
  • @sharedinstlock

atom_search(self, keyword, description=False, repositories=None, use_cache=True)

source code 

Search packages inside all the available repositories, including the installed packages one. Results are returned in random order by default, and as a list of package matches (pkg_id_int, repo_string).

Parameters:
  • keyword (string) - string to search
  • description (bool) - if True, also search through package description
  • repositories (string) - list of repository identifiers to search packages into
  • use_cache (bool) - if True, on-disk caching is used

packages_expand(self, packages)

source code 

Given a list of user requested packages, expands it resolving for instance, items such as package sets.

Parameters:
  • packages (list) - list of user requested packages
Returns: list
expanded list

calculate_masked_packages(self, *args, **kwargs)

source code 

Compute a list of masked packages. For masked packages it is meant a list of packages that cannot be installed without explicit user confirmation.

Parameters:
  • use_cache (bool) - use on-disk cache
Returns: list
list of masked package matches + mask reason id [((package_id, repository_id), reason_id), ...]
Decorators:
  • @sharedinstlock

calculate_available_packages(self, *args, **kwargs)

source code 

Compute a list of available packages in repositories. For available packages it is meant a list of non-installed packages.

Parameters:
  • use_cache (bool) - use on-disk cache
Returns: list
list of available package matches
Decorators:
  • @sharedinstlock

calculate_critical_updates(self, *args, **kwargs)

source code 
Decorators:
  • @sharedinstlock

calculate_security_updates(self, *args, **kwargs)

source code 

Return a list of security updates available using Entropy Security interface and Client.calculate_updates().

Parameters:
  • use_cache (bool) - Use Entropy cache, if available
Returns: list
list of Entropy package matches that should be updated
Decorators:
  • @sharedinstlock

calculate_updates(self, *args, **kwargs)

source code 

Calculate package updates. By default, this method also handles critical updates priority. Updates (as well as other objects here) are returned in alphabetical order. To generate a valid installation queue, have a look at Client.get_install_queue().

Parameters:
  • empty (bool) - consider the installed packages repository empty. Mark every package as update.
  • use_cache (bool) - use Entropy cache
  • critical_updates (bool) - if False, disable critical updates check priority.
  • quiet (bool) - do not print any status info if True
Returns: tuple
dict composed by (list of package matches ("update" key), list of installed package identifiers ("remove" key), list of package names already up-to-date ("fine" key), list of package names already up-to-date when user enabled "ignore-spm-downgrades", "spm_fine" key), if critical updates were found ("critical_found" key). If critical_found is True, relaxed dependencies calculation must be enforced.
Decorators:
  • @sharedinstlock

calculate_orphaned_packages(self, *args, **kwargs)

source code 

Collect Installed Packages that are no longer available in Entropy repositories due to their support being discontinued. If no orphaned packages are found, empty lists will be returned.

Returns: tuple
tuple composed by manually removable installed package ids (list) and automatically removable ones (list)
Decorators:
  • @sharedinstlock

check_package_update(self, *args, **kwargs)

source code 
Decorators:
  • @sharedinstlock

validate_package_removal(self, *args, **kwargs)

source code 

Determine whether given package identifier is allowed to be removed. System packages or per-repository-specified ones (generally handled by repository admins) could be critical for the health of the system. If repo_id is None, package_id has to point to an installed package identifier. In general, this function works with every repository, not just the installed packages one.

Parameters:
  • package_id (int) - Entropy package identifier
  • repo_id (string) - Entropy Repository identifier
Returns: bool
return True, if package can be removed, otherwise False.
Decorators:
  • @sharedinstlock

get_masked_packages(self, *args, **kwargs)

source code 

Return a list of masked packages which are dependencies of given package matches. NOTE: dependencies are not sorted.

Parameters:
  • package_matches (list) - list of package matches coming from Client.atom_match()
Returns: dict
dictionary composed by package match as key, and masking reason id as value (see etpConst['pkg_masking_reasons'] and etpConst['pkg_masking_reference']).
Decorators:
  • @sharedinstlock

get_removal_queue(self, *args, **kwargs)

source code 

Return removal queue (list of installed packages identifiers).

Parameters:
  • package_identifiers (list) - list of package identifiers proposed for removal (returned by inst_repo.listAllPackageIds())
  • deep (bool) - deeply scan inverse dependencies to include unused packages
  • recursive (bool) - scan inverse dependencies recursively, building a complete dependency graph
  • empty (bool) - when used with "deep", includes more reverse dependencies, especially useful for the removal of virtual packages.
  • system_packages (bool) - exclude system packages from reverse dependencies
Returns: list
list of installed package identifiers
Decorators:
  • @sharedinstlock
Raises:
  • DependenciesNotRemovable - if at least one reverse dependency is a system package and cannot be removed. The exception instance contains a "value" attribute providing a list of system package matches.

get_reverse_queue(self, *args, **kwargs)

source code 

Return a list of reverse dependecies for given package matches. This method works for every repository, not just the installed packages one.

Parameters:
  • recursive (bool) - scan inverse dependencies recursively, building a complete dependency graph
  • empty (bool) - when used with "deep", includes more reverse dependencies, especially useful for the removal of virtual packages.
  • system_packages (bool) - exclude system packages from reverse dependencies
  • deep (bool)
Returns: list
list of package matches
Decorators:
  • @sharedinstlock
Raises:
  • DependenciesNotRemovable - if at least one reverse dependency is a system package and cannot be removed. The exception instance contains a "value" attribute providing a list of system package matches.

get_install_queue(self, *args, **kwargs)

source code 

Return the ordered installation queue (including dependencies, if required), for given package matches.

Parameters:
  • package_matches (list) - list of package matches coming from Client.atom_match()
  • empty (bool) - consider installed packages repository as empty, pull in the complete dependency graph
  • deep (bool) - deeply scan dependencies, also include "softly" satisfied dependencies.
  • relaxed (bool) - use relaxed dependencies resolution algorithm, ignoring possible binary libraries with only API bumps (and no ABI). By default, Entropy Client also pulls in package updates even when not strictly required by the related dependency string.
  • build (bool) - Also include build-time dependencies.
  • quiet (bool) - do not print progress
  • recursive (bool) - scan dependencies recursively (usually, this is the wanted behaviour)
  • only_deps (bool) - only pull in package_matches dependencies and not themselves, unless they are also dependencies.
  • critical_updates (bool) - pull in critical updates if any
Returns:
tuple composed by a list of package matches to install and a list of package matches to remove (informational)
Decorators:
  • @sharedinstlock
Raises:
  • DependenciesCollision - packages pulled in conflicting depedencies perhaps sharing the same key and slot (but different version). In this case, user should mask one or the other by hand. The value encapsulated .value object attribute contains tuple of two elements: the list of colliding package (list of lists), and a dictionary with information about each package's (first level) reverse dependencies
  • DependenciesNotFound - one or more dependencies required are not found. The encapsulated .value object attribute contains a list of not found dependencies.