portage.dispatch_conf module

portage.dispatch_conf._archive_copy(src_st, src_path, dest_path)

Copy file from src_path to dest_path. Regular files and symlinks are supported. If an EnvironmentError occurs, then it is logged to stderr.

Parameters
  • src_st (posix.stat_result) – source file lstat result

  • src_path (str) – source file path

  • dest_path (str) – destination file path

portage.dispatch_conf._file_archive_ensure_dir(parent_dir)

Ensure that the parent directory for an archive exists. If a file exists where a directory is needed, then rename it (see bug 256376).

Parameters

parent_dir (str) – path of parent directory

portage.dispatch_conf._file_archive_rotate(archive)

Rename archive to archive + ‘.1’, and perform similar rotation for files up to archive + ‘.9’.

Parameters

archive (str) – file path to archive

portage.dispatch_conf.diff_mixed(func, file1, file2)
class portage.dispatch_conf.diff_mixed_wrapper(f, *args)

Bases: object

portage.dispatch_conf.diffstatusoutput(cmd, file1, file2)

Execute the string cmd in a shell with getstatusoutput() and return a 2-tuple (status, output).

portage.dispatch_conf.file_archive(archive, curconf, newconf, mrgconf)

Archive existing config to the archive-dir, bumping old versions out of the way into .# versions (log-rotate style). Then, if mrgconf was specified and there is a .dist version, merge the user’s changes and the distributed changes and put the result into mrgconf. Lastly, if newconf was specified, archive it as a .dist.new version (which gets moved to the .dist version at the end of the processing).

portage.dispatch_conf.file_archive_post_process(archive)

Rename the archive file with the .dist.new suffix to a .dist suffix

portage.dispatch_conf.rcs_archive(archive, curconf, newconf, mrgconf)

Archive existing config in rcs (on trunk). Then, if mrgconf is specified and an old branch version exists, merge the user’s changes and the distributed changes and put the result into mrgconf. Lastly, if newconf was specified, leave it in the archive dir with a .dist.new suffix along with the last 1.1.1 branch version with a .dist suffix.

portage.dispatch_conf.rcs_archive_post_process(archive)

Check in the archive file with the .dist.new suffix on the branch and remove the one with the .dist suffix.

portage.dispatch_conf.read_config(mandatory_opts)