Package entropy :: Package spm :: Package plugins :: Module skel :: Class SpmPlugin

Class SpmPlugin

source code


Base class for Source Package Manager plugins

Nested Classes
  Error
Base class for Source Package Manager exceptions.
  OutdatedPhaseError
Exception raised when phase execution detected an outdated version of the Source Package Manager.
  PhaseError
Exception raised when executing a package phase.
  PhaseFailure
Exception raised when Source Package Manager phase execution fails with a return code != 0.
Instance Methods
 
add_installed_package(self, package_metadata)
Add package installed by Entropy to SPM database too.
source code
bool
append_metadata_to_package(self, entropy_package_name, package_path)
Append Source Package Manager metadata bits to an Entropy package, known its name and path.
source code
int
assign_uid_to_installed_package(self, package, root=None)
Assign a new Unique Identifier to installed package and return it.
source code
 
clear(self)
Clear any allocated resources or caches.
source code
int
compile_packages(self, packages, stdin=None, stdout=None, stderr=None, environ=None, pid_write_func=None, pretend=False, verbose=False, fetch_only=False, build_only=False, no_dependencies=False, ask=False, coloured_output=False, oneshot=False)
Compile given packages using given compile options.
source code
string
convert_from_entropy_package_name(self, entropy_package_name)
This function should be able to convert an Entropy package name (atom) to a Source Package Manager one.
source code
int
environment_update(self)
Hook used by Entropy Client and Entropy Server to ask Source Package Manager to update /etc/profile* and other environment settings around.
source code
 
execute_package_phase(self, action_metadata, package_metadata, action_name, phase_name)
Execute Source Package Manager package phase (postinstall, preinstall, preremove, postremove, etc).
source code
dict
extract_package_metadata(self, package_file, license_callback=None, restricted_callback=None)
Extract Source Package Manager package metadata from given file.
source code
list
generate_package(self, package, file_save_path, builtin_debug=False)
Generate package tarball files for given package, from running system.
source code
string
get_cache_directory(self, root=None)
Return Source Package Manager cache directory path.
source code
list
get_download_mirrors(self, mirror_name)
Return list of download mirror URLs for given mirror name
source code
string
get_installed_package_build_script_path(self, package, root=None)
Return build script path for given package looking into installed packages repository.
source code
list
get_installed_package_content(self, package, root=None)
Return list of files/directories owned by package.
source code
string
get_installed_package_metadata(self, package, key, root=None)
Return package metadata referenced by "key" argument from installed packages repository.
source code
list
get_installed_packages(self, categories=None, root=None)
Return list of packages found in installed packages repository.
source code
list
get_merge_protected_paths(self)
Return a list of paths (either directories or files) whose are protected from direct merge requiring user approval.
source code
 
get_merge_protected_paths_mask(self)
Return a list of unprotected paths (either directories or files) which reside inside a protected path (see get_merge_protected_paths()).
source code
string
get_package_build_script_path(self, package)
Return build script path for given package looking through available packages repositories.
source code
list
get_package_categories(self)
Return list of package categories in available packages repositories.
source code
dict
get_package_category_description_metadata(self, category)
Return metadata for given package category containing description in all the available languages.
source code
string or None
get_package_changelog(self, package)
Return ChangeLog content for given package.
source code
string
get_package_metadata(self, package, key)
Return package metadata referenced by "key" argument from available packages repositories.
source code
dict
get_package_sets(self, builtin_sets)
Package sets are groups of packages meant to ease user installation and removal of large amount of applications or libraries.
source code
list
get_packages(self, categories=None, filter_reinstalls=False)
Return list of packages found in available repositories.
source code
dict
get_security_advisory_metadata(self, advisory_id)
Return Source Package Manager package security advisory metadata for given security advisory identifier.
source code
list
get_security_packages(self, security_property)
Return a list of packages affected by given security property argument.
source code
 
get_setting(self, key)
Return Source Package Manager setting referenced by "key"
source code
list
get_system_packages(self)
Return list of core (system) packages.
source code
string
get_user_installed_packages_file(self, root=None)
Return path to file containing list (one per line) of packages installed by user (in Portage world, this is the world file).
source code
frozenset
get_user_selected_packages(self, root=None)
Return installed list of packages that were selected by user as selected (wanted).
source code
 
init_singleton(self, output_interface)
Source Package Manager Plugin singleton method.
source code
float
installed_mtime(self, root=None)
Return the installed packages repository mtime that can be used for cache validation.
source code
 
log_message(self, message)
Log message string to logfile.
source code
string or list or None
match_installed_package(self, package, match_all=False, root=None)
Match a package looking through installed packages repository using the given match term argument (package).
source code
string or list or None
match_package(self, package, match_type=None)
Match a package looking through available packages repositories using the given match term argument (package) and match type (validity defined by subclasses).
source code
list
package_metadata_keys(self)
Return a list of package metadata keys available.
source code
 
package_names_update(self, entropy_repository, entropy_repository_id, entropy_server, entropy_branch)
WARNING: this is an Entropy Server functionality.
source code
 
packages_repositories_metadata_update(self, actions)
Executes Source Package Manager available packages repositories metadata update.
source code
int
print_build_environment_info(self, stdin=None, stdout=None, stderr=None, environ=None, pid_write_func=None, coloured_output=False)
Print build environment info to stdout.
source code
 
remove_installed_package(self, atom, package_metadata)
Remove installed package from SPM database.
source code
int
resolve_package_uid(self, entropy_repository, entropy_repository_package_id)
This is the bridge between Entropy package repository and its Source Package Manager backend.
source code
int
resolve_spm_package_uid(self, package)
Given a Source Package Manager atom, return its UID.
source code
dict
search_paths_owners(self, paths, exact_match=True)
Return list of packages owning provided list of paths.
source code

Inherited from core.Singleton: __init__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
bool
aggregate_package_metadata(entropy_package_path, metadata_path)
Aggregate raw Source Package Manager metadata contained in metadata_path to Entropy package.
source code
 
allocate_protected_file(package_file_path, destination_file_path)
Allocate a configuration protected file.
source code
list
binary_packages_extensions()
Return a list of file extensions belonging to binary packages.
source code
dict
config_files_map()
Return a map composed by configuration file identifiers and their path on disk.
source code
bool
dump_package_metadata(entropy_package_path, metadata_path)
Extract raw Source Package Manager metadata from Entropy package.
source code
int
entropy_client_post_repository_update_hook(entropy_client, entropy_repository_id)
This function is called by Entropy Client when updating Entropy repositories.
source code
int
entropy_install_setup_hook(entropy_client, package_metadata)
This function is called by Entropy Client during package metadata setup.
source code
int
entropy_install_unpack_hook(entropy_client, package_metadata)
This function is called by Entropy Client during package installation, unpack phase.
source code
tuple
execute_qa_tests(package_path)
Execute Source Package Manager based QA tests on Entropy package files.
source code
tuple
execute_system_qa_tests(entropy_output)
Execute Source Package Manager based QA tests on the whole system.
source code
 
external_triggers_dir()
External Entropy triggers executable directory This path should be used by SPM to read the trigger for packages inside extract_package_metadata()
source code
 
get_package_groups()
Return package groups available metadata (Spm categories are grouped into macro categories called "groups").
source code
list
package_phases()
Return a list of available and valid package build phases.
source code
dict
package_phases_map()
Return a map of phases names between Entropy (as keys) and Source Package Manager.
source code

Inherited from core.Singleton: __new__

Class Variables
  BASE_PLUGIN_API_VERSION = 12
  ENV_DIRS = set([])
  IS_DEFAULT = False
  PLUGIN_API_VERSION = -1
  PLUGIN_NAME = None
hash(x)
  SUPPORTED_MATCH_TYPES = []
Properties

Inherited from object: __class__

Method Details

add_installed_package(self, package_metadata)

source code 
Add package installed by Entropy to SPM database too.
"package_metadata" is a dictionary featuring the following (relevant)
keys:
    ['accept_license', 'imagedir', 'xpakpath', 'slot', 'pkgdbpath',
     'versiontag', 'version', 'xpakstatus', 'unpackdir', 'revision',
     'category', 'repository', 'xpakdir', 'name', 'install_source',
    ]

@param package_metadata: Entropy package metadata
@type package_metadata: dict
@return: SPM installed package UID or -1
@rtype: int

aggregate_package_metadata(entropy_package_path, metadata_path)
Static Method

source code 

Aggregate raw Source Package Manager metadata contained in metadata_path to Entropy package. This is the opposite of "dump_package_metadata()". This method must dump it's data to entropy_package_path and return True.

Parameters:
  • entropy_package_path (string) - path to Entropy package file
  • metadata_path (string) - Entropy package path
Returns: bool
True, if metadata has been appended successfully

allocate_protected_file(package_file_path, destination_file_path)
Static Method

source code 
Allocate a configuration protected file. This method returns a new
destination_file_path value that is used by Entropy Client code to
merge file at package_file_path to live system.
This method offers basic support for Entropy ability to protect user
configuration files against overwrites. Any subclass can hook code
here in order to trigger extra actions on every acknowledged
path modification.

@param package_file_path: a valid file path pointing to the file
    that Entropy Client is going to move to destination_file_path
@type package_file_path: string
@param destination_file_path: the default destination path for given
    package_file_path. It points to the live system.
@type destination_file_path: string
@return: Tuple (of length 2) composed by (1) a new destination file
    path. Please note that it can be the same of the one passed
    (destination_file_path) if no protection is taken (for eg. when
    md5 of proposed_file_path and destination_file_path is the same)
    and (2) a bool informing if the function actually protected the
    destination file. Unfortunately, the bool bit is stil required
    in order to provide a valid new destination_file_path in any case.
@rtype tuple

append_metadata_to_package(self, entropy_package_name, package_path)

source code 

Append Source Package Manager metadata bits to an Entropy package, known its name and path.

Parameters:
  • entropy_package_name (string) - Entropy package name
  • package_path (string) - Entropy package path
Returns: bool
True, if metadata has been appended successfully

assign_uid_to_installed_package(self, package, root=None)

source code 

Assign a new Unique Identifier to installed package and return it.

Parameters:
  • package (string) - package name
  • root (string) - specify an alternative root directory "/"
Returns: int
assigned Unique Identifier

binary_packages_extensions()
Static Method

source code 

Return a list of file extensions belonging to binary packages. The list cannot be empty. Elements must be provided without the leading dot (for tar.gz, provide "tar.gz" and not ".tar.gz")

Returns: list
list of supported packages extensions

compile_packages(self, packages, stdin=None, stdout=None, stderr=None, environ=None, pid_write_func=None, pretend=False, verbose=False, fetch_only=False, build_only=False, no_dependencies=False, ask=False, coloured_output=False, oneshot=False)

source code 

Compile given packages using given compile options. Extra compiler options can be set via environmental variables (CFLAGS, LDFLAGS, etc). By default, this function writes to stdout and can potentially interact with user via stdin/stdout/stderr. By default, when build_only=False, compiled packages are installed onto the running system.

Parameters:
  • packages (list) - list of Source Package Manager package names
  • stdin (file object or valid file descriptor number) - custom standard input
  • stdout (file object or valid file descriptor number) - custom standard output
  • stderr (file object or valid file descriptor number) - custom standard error
  • environ (map of environmental variables) - dict
  • pid_write_func (callable function, signature func(int_pid_number)) - function to call with execution pid number
  • pretend (bool) - just show what would be done
  • verbose (bool) - execute compilation in verbose mode
  • fetch_only (bool) - fetch source code only
  • build_only (bool) - do not actually touch live system (don't install compiled
  • no_dependencies (bool) - ignore possible build time dependencies
  • ask (bool) - ask user via stdin before executing the required tasks
  • coloured_output (bool) - allow coloured output
  • oneshot (bool) - when compiled packages are intended to not get recorded into personal user compile preferences (if you are not using a Portage-based SPM, just ignore this)
Returns: int
execution status

config_files_map()
Static Method

source code 

Return a map composed by configuration file identifiers and their path on disk. These configuration files are related to Source Package Manager.

Returns: dict
configuration files map

convert_from_entropy_package_name(self, entropy_package_name)

source code 

This function should be able to convert an Entropy package name (atom) to a Source Package Manager one.

Parameters:
  • entropy_package_name (string) - Entropy package name string
Returns: string
Source Package Manager package name string

dump_package_metadata(entropy_package_path, metadata_path)
Static Method

source code 

Extract raw Source Package Manager metadata from Entropy package. This is the opposite of "append_metadata_to_package()". This method must dump it's data to metadata_path and return True.

Parameters:
  • entropy_package_path (string) - path to Entropy package file
  • metadata_path (string) - Entropy package path
Returns: bool
True, if metadata has been appended successfully

entropy_client_post_repository_update_hook(entropy_client, entropy_repository_id)
Static Method

source code 

This function is called by Entropy Client when updating Entropy repositories. Place here all your Source Package Manager bullshit and, remember to return an int form execution status.

Parameters:
  • entropy_client (entropy.client.interfaces.Client.Client) - Entropy Client interface instance
  • entropy_repository_id - Entropy Repository unique identifier
Returns: int
execution status

entropy_install_setup_hook(entropy_client, package_metadata)
Static Method

source code 

This function is called by Entropy Client during package metadata setup. It is intended to be used to inject additional metadata (that would be used afterwards in other entropy_install_* hooks) to entropy package install metadata. Note: for performance reasons, this is a static method !

Parameters:
  • entropy_client (entropy.client.interfaces.Client.Client) - Entropy Client interface instance
  • package_metadata (dict) - Entropy package metadata
Returns: int
execution status

entropy_install_unpack_hook(entropy_client, package_metadata)
Static Method

source code 

This function is called by Entropy Client during package installation, unpack phase. It is intended to be used to extract, if required, Source Package Manager metadata from Entropy packages useful for installing package into Source Package Manager plugin too. For example, PortagePlugin uses this hook to extract xpak metadata from entropy package files and setup Portage directories. Note: for performance reasons, this is a static method !

Parameters:
  • entropy_client (entropy.client.interfaces.Client.Client) - Entropy Client interface instance
  • package_metadata (dict) - Entropy package metadata
Returns: int
execution status

environment_update(self)

source code 

Hook used by Entropy Client and Entropy Server to ask Source Package Manager to update /etc/profile* and other environment settings around. Since this is part of the Source Package Manager metaphor it must stay in this class.

Returns: int
execution status

execute_package_phase(self, action_metadata, package_metadata, action_name, phase_name)

source code 

Execute Source Package Manager package phase (postinstall, preinstall, preremove, postremove, etc).

Parameters:
  • action_metadata (dict or None) - metadata bound to the action and not to the actual phase requested (for example, when updating a package, during the removal phase, action_metadata contains the new package -- being merged -- metadata)
  • package_metadata (dict) - Entropy package phase metadata
  • action_name (string) - Entropy package action name, can be "install", "remove"
  • phase_name (string) - name of the phase to call, must be a valid phase contained in package_phases() output.
Raises:
  • KeyError - if phase is not available
  • SpmPlugin.PhaseFailure - when the phase executed but returned a non-zero exit status. These exceptions should be considered non-fatal
  • SpmPlugin.PhaseError - when the phase cannot be executed
  • SpmPlugin.OutdatedPhaseError - when Source Package Manager is too old to execute the phase. This is a subclass of PhaseError

execute_qa_tests(package_path)
Static Method

source code 

Execute Source Package Manager based QA tests on Entropy package files. This method can be used to test Entropy produced packages to make sure that they are fine on this side too. It is called by Entropy QA module (entropy.qa).

Parameters:
  • package_path (string) - path to Entropy package
Returns: tuple
tuple composed by error status and error message (if any). Error status is an int with != 0 values if error occurred.

execute_system_qa_tests(entropy_output)
Static Method

source code 

Execute Source Package Manager based QA tests on the whole system. This method can be used to make sure that at the time of pushing a new Entropy repository, the system is in consistent state. It is called by Entropy Server, during pre-repository upload QA checks. This method must return a tuple composed by exit status and error message. Error message is considered only if exit status != 0.

Parameters:
  • entropy_output (TextInterface object) - a valid text output interface
Returns: tuple
tuple composed by error status and error message (if any). Error status is an int with != 0 values if error occurred.

extract_package_metadata(self, package_file, license_callback=None, restricted_callback=None)

source code 

Extract Source Package Manager package metadata from given file.

Parameters:
  • package_file (string) - path to valid SPM package file
  • license_callback (callable) - if not None, it will be used to determine if package_file can be considered free (as in freedom) or not. Please return True if so, otherwise false. The signature of the callback is: bool callback(pkg_metadata).
  • restricted_callback (callable) - if not None, it will be used to determine if package_file can be considered legal in all countries or not. Please return True if so, otherwise false. The signature of the callback is: bool callback(pkg_metadata).
Returns: dict
package metadata extracted
Raises:

generate_package(self, package, file_save_path, builtin_debug=False)

source code 

Generate package tarball files for given package, from running system. All the information is recomposed from system.

Parameters:
  • package (string) - package name
  • file_save_path (string) - exact path (including file name and extension) where package file is saved
  • builtin_debug (bool) - embed debug files into the generated package file. If False, another package file is generated and appended to the return list.
Returns: list
list of package file paths, the first is the main one, the second in list, if available, is the debug package. All these extra package files must end with etpConst['packagesextraext'] extension.
Raises:

get_cache_directory(self, root=None)

source code 

Return Source Package Manager cache directory path.

Parameters:
  • root (string) - specify an alternative root directory "/"
Returns: string
cache directory

get_download_mirrors(self, mirror_name)

source code 

Return list of download mirror URLs for given mirror name

Parameters:
  • mirror_name (string) - mirror name
Returns: list
list of download URLs

get_installed_package_build_script_path(self, package, root=None)

source code 

Return build script path for given package looking into installed packages repository.

Parameters:
  • package (string) - package name
  • root (string) - specify an alternative root directory "/"
Returns: string
build script path

get_installed_package_content(self, package, root=None)

source code 

Return list of files/directories owned by package.

Parameters:
  • package (string) - package name
  • root (string) - specify an alternative root directory "/"
Returns: list
list of files/directories owned by package

get_installed_package_metadata(self, package, key, root=None)

source code 

Return package metadata referenced by "key" argument from installed packages repository.

Parameters:
  • package (string) - package identifier
  • key (string) - metadata key (name)
  • root (string) - specify an alternative root directory "/"
Returns: string
package metadata value
Raises:
  • KeyError - if package is not available

get_installed_packages(self, categories=None, root=None)

source code 

Return list of packages found in installed packages repository. Extra "filtering" arguments can be passed like "categories", which will make this method returning only packages found in given category list.

Parameters:
  • categories (iterable) - list of package categories to look into
  • root (string) - specify an alternative root directory "/"
Returns: list
list of installed packages found

get_merge_protected_paths(self)

source code 

Return a list of paths (either directories or files) whose are protected from direct merge requiring user approval.

Returns: list
list of protected paths

get_package_build_script_path(self, package)

source code 

Return build script path for given package looking through available packages repositories.

Parameters:
  • package (string) - package name
Returns: string
build script path

get_package_categories(self)

source code 

Return list of package categories in available packages repositories.

Returns: list
list of package categories

get_package_category_description_metadata(self, category)

source code 

Return metadata for given package category containing description in all the available languages. Data is returned in dict form, locale names as key, description text as value.

Parameters:
  • category (string) - package category name
Returns: dict
category description metadata

get_package_changelog(self, package)

source code 

Return ChangeLog content for given package.

Parameters:
  • package (string) - package name
Returns: string or None
changelog

get_package_metadata(self, package, key)

source code 

Return package metadata referenced by "key" argument from available packages repositories.

Parameters:
  • package (string) - package name
  • key (string) - metadata key (name)
Returns: string
package metadata value

get_package_sets(self, builtin_sets)

source code 

Package sets are groups of packages meant to ease user installation and removal of large amount of applications or libraries. The difference between package groups is that sets can be referenced anywhere inside Entropy, while the former is just a simple way to group pacakge categories, usually too hard to understand (for eg. "sys-apps" or "app-misc", where user has no clue about the meaning of these). Third party implementations of SPM can just return empty data if this feature is not wanted or implementable.

Parameters:
  • builtin_sets (bool) - if True, also return SPM built-in package sets
Returns: dict
dictionary featuring set name as key, list (set) of package dependencies as value

get_packages(self, categories=None, filter_reinstalls=False)

source code 

Return list of packages found in available repositories. Extra "filtering" arguments can be passed like "categories", which will make this method returning only packages found in given category list and "filter_reinstalls" which will actually filter out packages already installed (with no updates nor downgrades available).

Parameters:
  • categories (iterable) - list of package categories to look into
  • filter_reinstalls (bool) - enable reinstall packages filter
Returns: list
list of available packages found

To Do: improve method, move filter_reinstalls to another function?

get_security_advisory_metadata(self, advisory_id)

source code 

Return Source Package Manager package security advisory metadata for given security advisory identifier.

Parameters:
  • advisory_id (string) - security advisory identifier
Returns: dict
advisory metadata

get_security_packages(self, security_property)

source code 

Return a list of packages affected by given security property argument. Valid security_property values are: affected, new, all.

Parameters:
  • security_property (string) - packages security property
Returns: list
list of packages affected by given security property

get_setting(self, key)

source code 

Return Source Package Manager setting referenced by "key"

Parameters:
  • key (string) - source package manager setting
Raises:
  • KeyError - if setting is not available

get_system_packages(self)

source code 

Return list of core (system) packages. Core packages are usually consider vital for basic system operativity.

Returns: list
list of system packages

get_user_installed_packages_file(self, root=None)

source code 

Return path to file containing list (one per line) of packages installed by user (in Portage world, this is the world file).

Parameters:
  • root (string) - specify an alternative root directory "/"
Returns: string
path to installed packages list file

get_user_selected_packages(self, root=None)

source code 

Return installed list of packages that were selected by user as selected (wanted). Packages returned by this function can have a different representation from what e.g. get_installed_packages() returns, that is, no package matching is done for performance.

Parameters:
  • root (string) - specify an alternative root directory "/"
Returns: frozenset
list of installed packages found
Raises:

init_singleton(self, output_interface)

source code 

Source Package Manager Plugin singleton method. This method must be reimplemented by subclasses.

Parameters:
  • output_interface (entropy.output.TextInterface based instances) - Entropy output interface
Raises:
  • NotImplementedError() - when method is not reimplemented

installed_mtime(self, root=None)

source code 

Return the installed packages repository mtime that can be used for cache validation.

Parameters:
  • root (string) - specify an alternative root directory "/"
Returns: float
the installed repository mtime value

log_message(self, message)

source code 

Log message string to logfile.

Parameters:
  • message (string) - message string to log

match_installed_package(self, package, match_all=False, root=None)

source code 

Match a package looking through installed packages repository using the given match term argument (package).

Parameters:
  • package (string) - package string to match inside installed packages repository
  • match_all (bool) - return all the matching packages, not just the best
  • root (string) - specify an alternative root directory "/"
Returns: string or list or None
matched package (atom) or None
Raises:
  • KeyError - if match_type is not valid

match_package(self, package, match_type=None)

source code 

Match a package looking through available packages repositories using the given match term argument (package) and match type (validity defined by subclasses).

Parameters:
  • package (string) - package string to match inside available repositories
  • match_type (string) - match type
Returns: string or list or None
matched package (atom) or None
Raises:
  • KeyError - if match_type is not valid

package_metadata_keys(self)

source code 

Return a list of package metadata keys available.

Returns: list
list of package metadata

package_names_update(self, entropy_repository, entropy_repository_id, entropy_server, entropy_branch)

source code 

WARNING: this is an Entropy Server functionality. Execute the synchronization (if needed) of Source Package Manager package names with Entropy ones, stored inside the passed EntropyRepository instance (entropy_repository) referenced by an unique identifier (entropy_repository_id) for the given Entropy packages branch (entropy_branch). This method must also take care of the Entropy package names update file returned by Entropy server instance (entropy_server) method "get_local_database_treeupdates_file". If your Source Package Manager packages are subject to name changes, you must implement this method to effectively keep Entropy aligned with it.

Parameters:
  • entropy_repository (entropy.db.EntropyRepository) - EntropyRepository instance
  • entropy_repository_id (string) - Entropy Repository unique identifier
  • entropy_server (entropy.server.interfaces.Server instance) - Entropy Server instance
  • entropy_branch (string (SystemSettings['repositories']['branch'])) - Entropy branch string (may be handy to selectively execute updates based on working branch)

package_phases()
Static Method

source code 

Return a list of available and valid package build phases. Default value is ["setup", "preinstall", "postinstall", "preremove", "postremove"]

Returns: list
list of available and valid package build phases

package_phases_map()
Static Method

source code 

Return a map of phases names between Entropy (as keys) and Source Package Manager.

Returns: dict
map of package phases

packages_repositories_metadata_update(self, actions)

source code 

Executes Source Package Manager available packages repositories metadata update.

Parameters:
  • actions (list) - a list of metadata update strings

print_build_environment_info(self, stdin=None, stdout=None, stderr=None, environ=None, pid_write_func=None, coloured_output=False)

source code 

Print build environment info to stdout.

Parameters:
  • stdin (file object or valid file descriptor number) - custom standard input
  • stdout (file object or valid file descriptor number) - custom standard output
  • stderr (file object or valid file descriptor number) - custom standard error
  • environ (map of environmental variables) - dict
  • pid_write_func (callable function, signature func(int_pid_number)) - function to call with execution pid number
  • coloured_output (bool) - allow coloured output
Returns: int
execution status

remove_installed_package(self, atom, package_metadata)

source code 
Remove installed package from SPM database.
"package_metadata" is a dictionary featuring the following (relevant)
keys:
    ['accept_license', 'imagedir', 'xpakpath', 'slot', 'pkgdbpath',
     'versiontag', 'version', 'xpakstatus', 'unpackdir', 'revision',
     'category', 'repository', 'xpakdir', 'name', 'install_source',
    ]

@param atom: the Entropy package atom
@type atom: string
@param package_metadata: Entropy package metadata
@type package_metadata: dict
@return: execution status
@rtype: int

resolve_package_uid(self, entropy_repository, entropy_repository_package_id)

source code 

This is the bridge between Entropy package repository and its Source Package Manager backend. Given an EntropyRepository instance and its package identifier (which is available inside it). Return the package Unique Identifier that is bound to it, if available, otherwise return None. This function is used by EntropyRepository to regenerate Entropy<->Spm package bindings.

Parameters:
  • entropy_repository (EntropyRepository) - EntropyRepository instance
  • entropy_repository_package_id (int) - EntropyRepository instance package identifier
Returns: int
bound Source Package Manager Unique Identifier
Raises:

resolve_spm_package_uid(self, package)

source code 

Given a Source Package Manager atom, return its UID.

Parameters:
  • package (string) - Source Package Manager atom
Returns: int
Source Package Manager UID for package
Raises:
  • KeyError - in case the package cannot be resolved into UID.

search_paths_owners(self, paths, exact_match=True)

source code 

Return list of packages owning provided list of paths. A dictionary is returned containing package name as key and list of matched paths as value.

Parameters:
  • paths (list) - list of paths to resolve
  • exact_match (bool) - match paths exactly
Returns: dict
packages owning list of paths