This module is a bridge between low-level logging services and high level handling dependency logic.

It can be used to launch a program and get all file events

logfs.fstracer.getfsevents(prog_name, arguments, approach='hooklib', filterproc=<function defaultfilter at 0x1dcb938>)[source]

Launches a program and gets file access events

  • prog_name – name of program
  • arguments – list of program’s arguments
  • approach – a logging approach(‘hooklib’ or ‘fusefs’)
  • filterproc – filter function, this function should take 3 strings: name of event, name of file and stage, and return a True if event is allowed and False instead. Name of event is one of ‘open’, ‘read’ or ‘write’. Default function always returns True.

list with two elements - success events and failed events. Each element is dictionary stage->file information. File information is also a dictionary filename->type of events. Type of events for success events is a 2-element tuple: (was file readed, was file writed). For failed events it is also 2-element tuple: (was file not found, was file blocked by filterproc). Each element of tuple can be True or False. Both elements of tuple can be False. Stage can be ‘unknown’


This package contains modules which work with the Portage system

package_utils.portage_log_parser.get_list_of_merged_packages(starttime=0, endtime=-1)[source]

Parses an emerge log and finds first successfully merged packages chain

  • starttime – start time for searching(in seconds since 1970)
  • starttime – end time for searching(in seconds since 1970).

list of package names


Memory-hungry operation

Returns:set of all files that belongs to package
Parameters:packagename – name of package
Returns:list of files in package with name packagename
Parameters:files – list of filenames
Returns:dictionary file->package, if file doesn’t belong to any package it not returned as key of this dictionary
class package_utils.portage_misc_functions.portage_api[source]

class for accessing the portage api


Gets best candidate on installing. Returns empty string if no found

Parameters:pkg – package name
get_dep(pkg, dep_type=['RDEPEND', 'DEPEND'])

Gets current dependencies of a package. Looks in portage db

  • pkg – name of package
  • dep_type – type of dependencies to recurse. Can be [“DEPEND”] or [“RDEPEND”, “DEPEND”]

set of packages names

get_deps(pkg, dep_type=['RDEPEND', 'DEPEND'])[source]

Gets current dependencies of a package on any depth All dependencies must be installed

  • pkg – name of package
  • dep_type – type of dependencies to recurse. Can be [“DEPEND”] or [“RDEPEND”, “DEPEND”]

set of packages names


Gets list of packages that emerge with emergeargs-arguments will merge This function uses very internal functions of portage so it may be unreliable in various portage versions

Parameters:emergeargs – list of raw args of emerge, for example, [‘-1’,’bash’]

returns all packages from system set. They are always implicit dependencies

Returns:list of package names

call emerge arguments parser

Parameters:args – arguments passed to emerge
Returns:tuple (action string, options dictionary, files or atoms list)

Table Of Contents

Previous topic


This Page