Package entropy :: Package client :: Package interfaces :: Module methods :: Class MatchMixin

Class MatchMixin

source code


Instance Methods
int
get_package_action(self, *args, **kwargs)
For given package match, return an action value representing the current status of the package: either "upgradable" (return status: 2), "installable" (return status: 1), "reinstallable" (return status: 0), "downgradable" (return status -1).
source code
bool
is_package_masked(self, package_match, live_check=True)
Determine whether given package match belongs to a masked package.
source code
bool
is_package_masked_by_user(self, package_match, live_check=True)
Determine whether given package match belongs to a masked package, requested by user (user explicitly masked the package).
source code
bool
is_package_unmasked_by_user(self, package_match, live_check=True)
Determine whether given package match belongs to an unmasked package, requested by user (user explicitly unmasked the package).
source code
bool
mask_package(self, package_match, method='atom', dry_run=False)
Mask given package match.
source code
bool
mask_package_generic(self, package_match, keyword, dry_run=False)
Mask package using string passed in "keyword".
source code
list
search_available_mimetype(self, mimetype)
Given a mimetype, return list of available package matches belonging to packages that can handle it.
source code
list
search_installed_mimetype(self, *args, **kwargs)
Given a mimetype, return list of installed package identifiers belonging to packages that can handle it.
source code
bool
unmask_package(self, package_match, method='atom', dry_run=False)
Unmask given package match.
source code
bool
unmask_package_generic(self, package_match, keyword, dry_run=False)
Unmask package using string passed in "keyword".
source code
Method Details

get_package_action(self, *args, **kwargs)

source code 

For given package match, return an action value representing the current status of the package: either "upgradable" (return status: 2), "installable" (return status: 1), "reinstallable" (return status: 0), "downgradable" (return status -1).

Parameters:
  • package_match (tuple) - entropy package match (package_id, repository_id)
  • installed_package_id (int) - if set, it will speed up the lookup
Returns: int
package status
Decorators:
  • @sharedinstlock

is_package_masked(self, package_match, live_check=True)

source code 

Determine whether given package match belongs to a masked package. If live_check is True, even temporary masks (called live masking because they belong to this running Entropy instance only) will be considered.

Parameters:
  • package_match (tuple) - entropy package match (package_id, repository_id)
  • live_check (bool) - check for live masks (default is True)
Returns: bool
True, if package is masked, False otherwise

is_package_masked_by_user(self, package_match, live_check=True)

source code 

Determine whether given package match belongs to a masked package, requested by user (user explicitly masked the package). If live_check is True, even temporary masks (called live masking because they belong to this running Entropy instance only) will be considered.

Parameters:
  • package_match (tuple) - entropy package match (package_id, repository_id)
  • live_check (bool) - check for live masks (default is True)
Returns: bool
True, if package is masked by user, False otherwise

is_package_unmasked_by_user(self, package_match, live_check=True)

source code 

Determine whether given package match belongs to an unmasked package, requested by user (user explicitly unmasked the package). If live_check is True, even temporary masks (called live masking because they belong to this running Entropy instance only) will be considered.

Parameters:
  • package_match (tuple) - entropy package match (package_id, repository_id)
  • live_check (bool) - check for live masks (default is True)
Returns: bool
True, if package is unmasked by user, False otherwise

mask_package(self, package_match, method='atom', dry_run=False)

source code 

Mask given package match. Two masking methods are available: either by "atom" (exact package string will be used) or by "keyslot" (package key + slot combo will be used).

Parameters:
  • package_match (tuple) - entropy package match (package_id, repository_id)
  • method (string) - masking method (either "atom" or "keyslot").
  • dry_run (bool) - execute a "dry" run
Returns: bool
True, if package has been masked successfully

mask_package_generic(self, package_match, keyword, dry_run=False)

source code 

Mask package using string passed in "keyword". A package match is still required because previous unmasks have to be cleared.

Parameters:
  • package_match (tuple) - entropy package match (package_id, repository_id)
  • keyword (string) - the package string to mask
  • dry_run (bool) - execute a "dry" run
Returns: bool
True, if mask went fine, False otherwise

search_available_mimetype(self, mimetype)

source code 

Given a mimetype, return list of available package matches belonging to packages that can handle it.

Parameters:
  • mimetype (string) - mimetype string
Returns: list
list of available package matches

search_installed_mimetype(self, *args, **kwargs)

source code 

Given a mimetype, return list of installed package identifiers belonging to packages that can handle it.

Parameters:
  • mimetype (string) - mimetype string
Returns: list
list of installed package identifiers
Decorators:
  • @sharedinstlock

unmask_package(self, package_match, method='atom', dry_run=False)

source code 

Unmask given package match. Two unmasking methods are available: either by "atom" (exact package string will be used) or by "keyslot" (package key + slot combo will be used).

Parameters:
  • package_match (tuple) - entropy package match (package_id, repository_id)
  • method (string) - masking method (either "atom" or "keyslot").
  • dry_run (bool) - execute a "dry" run
Returns: bool
True, if package has been unmasked successfully

unmask_package_generic(self, package_match, keyword, dry_run=False)

source code 

Unmask package using string passed in "keyword". A package match is still required because previous masks have to be cleared.

Parameters:
  • package_match (tuple) - entropy package match (package_id, repository_id)
  • keyword (string) - the package string to unmask
  • dry_run (bool) - execute a "dry" run
Returns: bool
True, if unmask went fine, False otherwise