pkgcore.merge.triggers module

triggers, callables to bind to a step in a MergeEngine to affect changes

class pkgcore.merge.triggers.BaseSystemUnmergeProtection(preserve_sequence=None)[source]

Bases: base

priority = -100
required_csets = ('uninstall',)
suppress_exceptions = False
trigger(engine, uninstall)[source]
class pkgcore.merge.triggers.BinaryDebug(mode='split', strip_binary=None, objcopy_binary=None, extra_strip_flags=(), debug_storage='/usr/lib/debug/', compress=False)[source]

Bases: ThreadedTrigger

default_strip_flags = ('--strip-unneeded', '-R', '.comment')
elf_regex = '(^| )ELF +(\\d+-bit )'
identify_work(engine, cset)[source]
required_csets = ('install',)
threading_get_args(engine, cset)[source]
class pkgcore.merge.triggers.BlockFileType(bad_regex, regex_to_check=None, fatal=True)[source]

Bases: base

required_csets = ('new_cset',)
trigger(engine, cset)[source]
class pkgcore.merge.triggers.CommonDirectoryModes[source]

Bases: base

directories = frozenset({'/bin', '/etc', '/lib', '/lib32', '/lib64', '/sbin', '/usr', '/usr/bin', '/usr/lib', '/usr/lib32', '/usr/lib64', '/usr/local', '/usr/sbin', '/usr/share', '/usr/share/info', '/usr/share/man', '/usr/share/man/man1', '/usr/share/man/man2', '/usr/share/man/man3', '/usr/share/man/man4', '/usr/share/man/man5', '/usr/share/man/man6', '/usr/share/man/man7', '/usr/share/man/man8', '/usr/share/man/man9', '/var'})
required_csets = ('new_cset',)
trigger(engine, cset)[source]
class pkgcore.merge.triggers.InfoRegen[source]

Bases: base

get_binary_path()[source]
locations = ('/usr/share/info',)
regen(binary, basepath)[source]
required_csets = ()
should_skip_directory(basepath, files)[source]
trigger(engine)[source]
class pkgcore.merge.triggers.PruneFiles(sentinel_func)[source]

Bases: base

required_csets = ('new_cset',)
trigger(engine, cset)[source]
class pkgcore.merge.triggers.SavePkg(target_repo, pristine=True, skip_if_source=True)[source]

Bases: base

priority = 90
required_csets = ('raw_new_cset',)
trigger(engine, cset)[source]
class pkgcore.merge.triggers.base[source]

Bases: object

base trigger class

Variables:
  • required_csets – If None, all csets are passed in, else it must be a sequence, those specific csets are passed in

  • _label – Either None, or a string to use for this triggers label

  • _hook – sequence of hook points to register into

  • priority – range of 0 to 100, order of execution for triggers per hook

  • _engine_types – if None, trigger works for all engine modes, else it’s limited to that mode, and must be a sequence

get_required_csets(mode)[source]
property label
localize(engine)[source]

‘localize’ a trigger to a specific merge engine process mainly used if the trigger comes from configuration

priority = 50
register(engine)[source]

register with a MergeEngine

required_csets = None
suppress_exceptions = True
trigger(engine, csets)[source]
class pkgcore.merge.triggers.detect_world_writable(fix_perms=False)[source]

Bases: base

required_csets = ('new_cset',)
trigger(engine, cset)[source]
class pkgcore.merge.triggers.fix_gid_perms(gid=0, replacement=0)[source]

Bases: base

required_csets = ('new_cset',)
trigger(engine, cset)[source]
class pkgcore.merge.triggers.fix_set_bits[source]

Bases: base

required_csets = ('new_cset',)
trigger(engine, cset)[source]
class pkgcore.merge.triggers.fix_uid_perms(uid=0, replacement=0)[source]

Bases: base

required_csets = ('new_cset',)
trigger(engine, cset)[source]
class pkgcore.merge.triggers.ldconfig(ld_so_conf_path='etc/ld.so.conf')[source]

Bases: base

default_ld_path = ['usr/lib', 'usr/lib64', 'usr/lib32', 'lib', 'lib64', 'lib32']
ld_so_path(offset)[source]
priority = 10
read_ld_so_conf(offset)[source]
regen(engine)[source]
required_csets = ()
trigger(engine)[source]
class pkgcore.merge.triggers.merge[source]

Bases: base

required_csets = ('install',)
suppress_exceptions = False
trigger(engine, merging_cset)[source]
class pkgcore.merge.triggers.unmerge[source]

Bases: base

required_csets = ('uninstall',)
suppress_exceptions = False
trigger(engine, unmerging_cset)[source]