portage.package.ebuild._config.KeywordsManager module

class portage.package.ebuild._config.KeywordsManager.KeywordsManager(profiles, abs_user_config, user_config=True, global_accept_keywords='')

Bases: object

Manager class to handle keywords processing and validation

static _getEgroups(egroups, mygroups)

gets any keywords defined in the environment

Parameters

backuped_accept_keywords (String) – ACCEPT_KEYWORDS from the backup env

Return type

List

Returns

list of KEYWORDS that have been accepted

static _getMissingKeywords(cpv, pgroups, mygroups)

Determines the missing keywords

Parameters
  • pgroups (list) – The pkg keywords accepted

  • mygroups (list) – The ebuild keywords

getKeywords(cpv, slot, keywords, repo)
getMissingKeywords(cpv, slot, keywords, repo, global_accept_keywords, backuped_accept_keywords)

Take a package and return a list of any KEYWORDS that the user may need to accept for the given package. If the KEYWORDS are empty and the ** keyword has not been accepted, the returned list will contain ** alone (in order to distinguish from the case of “none missing”).

Parameters
  • cpv (String) – The package name (for package.keywords support)

  • slot (String) – The ‘SLOT’ key from the raw package metadata

  • keywords (String) – The ‘KEYWORDS’ key from the raw package metadata

  • global_accept_keywords (String) – The current value of ACCEPT_KEYWORDS

  • backuped_accept_keywords (String) – ACCEPT_KEYWORDS from the backup env

Return type

List

Returns

A list of KEYWORDS that have not been accepted.

getPKeywords(cpv, slot, repo, global_accept_keywords)

Gets any package.keywords settings for cp for the given cpv, slot and repo

Parameters
  • cpv (String) – The package name (for package.keywords support)

  • slot (String) – The ‘SLOT’ key from the raw package metadata

  • keywords (String) – The ‘KEYWORDS’ key from the raw package metadata

  • global_accept_keywords (String) – The current value of ACCEPT_KEYWORDS

  • backuped_accept_keywords (String) – ACCEPT_KEYWORDS from the backup env

Return type

List

Returns

list of KEYWORDS that have been accepted

getRawMissingKeywords(cpv, slot, keywords, repo, global_accept_keywords)

Take a package and return a list of any KEYWORDS that the user may need to accept for the given package. If the KEYWORDS are empty, the returned list will contain ** alone (in order to distinguish from the case of “none missing”). This DOES NOT apply any user config package.accept_keywords acceptance.

Parameters
  • cpv (String) – The package name (for package.keywords support)

  • slot (String) – The ‘SLOT’ key from the raw package metadata

  • keywords (String) – The ‘KEYWORDS’ key from the raw package metadata

  • global_accept_keywords (String) – The current value of ACCEPT_KEYWORDS

Return type

List

Returns

lists of KEYWORDS that have not been accepted

and the keywords it looked for.

isStable(pkg, global_accept_keywords, backuped_accept_keywords)