portage.util.install_mask module

class portage.util.install_mask.InstallMask(install_mask)

Bases: object

_iter_relevant_patterns(path)

Iterate over patterns that may be relevant for the given path.

Patterns anchored with leading / are indexed by leading non-glob components, making it possible to minimize the number of fnmatch calls.

match(path)
Parameters

path (str) – file path relative to ${ED}

Return type

bool

Returns

True if path matches INSTALL_MASK, False otherwise

portage.util.install_mask._defaultdict_tree()
class portage.util.install_mask._pattern(orig_index, is_inclusive, pattern, leading_slash)

Bases: tuple

_asdict()

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

_field_defaults = {}
_fields = ('orig_index', 'is_inclusive', 'pattern', 'leading_slash')
classmethod _make(iterable)

Make a new _pattern object from a sequence or iterable

_replace(**kwds)

Return a new _pattern 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.

is_inclusive

Alias for field number 1

leading_slash

Alias for field number 3

orig_index

Alias for field number 0

pattern

Alias for field number 2

portage.util.install_mask._raise_exc(e)

Wrap OSError with portage.exception wrapper exceptions, with __cause__ chaining when python supports it.

Parameters

e (OSError) – os exception

Raises

PortageException – portage.exception wrapper exception

portage.util.install_mask.install_mask_dir(base_dir, install_mask, onerror=None)

Remove files and directories matched by INSTALL_MASK.

Parameters
  • base_dir (str) – directory path corresponding to ${ED}

  • install_mask (InstallMask) – INSTALL_MASK configuration