Package portage :: Module dispatch_conf
[hide private]

Module dispatch_conf

source code

Classes [hide private]
  diff_mixed_wrapper
Functions [hide private]
 
diffstatusoutput(cmd, file1, file2)
Execute the string cmd in a shell with getstatusoutput() and return a 2-tuple (status, output).
source code
 
diff_mixed(func, file1, file2) source code
 
read_config(mandatory_opts) source code
 
_archive_copy(src_st, src_path, dest_path)
Copy file from src_path to dest_path.
source code
 
rcs_archive(archive, curconf, newconf, mrgconf)
Archive existing config in rcs (on trunk).
source code
 
_file_archive_rotate(archive)
Rename archive to archive + '.1', and perform similar rotation for files up to archive + '.9'.
source code
 
_file_archive_ensure_dir(parent_dir)
Ensure that the parent directory for an archive exists.
source code
 
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).
source code
 
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.
source code
 
file_archive_post_process(archive)
Rename the archive file with the .dist.new suffix to a .dist suffix
source code
Variables [hide private]
  RCS_BRANCH = u'1.1.1'
  RCS_LOCK = u'rcs -ko -M -l'
  RCS_PUT = u'ci -t-"Archived config file." -m"dispatch-conf upd...
  RCS_GET = u'co'
  RCS_MERGE = u'rcsmerge -p -r1.1.1 '%s' > '%s''
  DIFF3_MERGE = u'diff3 -mE '%s' '%s' '%s' > '%s''
  _ARCHIVE_ROTATE_MAX = 9
  diffstatusoutput_mixed = <portage.dispatch_conf.diff_mixed_wra...
  __package__ = 'portage'

Imports: errno, io, functools, stat, subprocess, sys, tempfile, portage, _encodings, os, shutil, KeyValuePairFileLoader, _, shlex_split, varexpand, iter_parents


Function Details [hide private]

_archive_copy(src_st, src_path, dest_path)

source code 

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

rcs_archive(archive, curconf, newconf, mrgconf)

source code 

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.

_file_archive_rotate(archive)

source code 

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

Parameters:
  • archive (str) - file path to archive

_file_archive_ensure_dir(parent_dir)

source code 

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

file_archive(archive, curconf, newconf, mrgconf)

source code 

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).


Variables Details [hide private]

RCS_PUT

Value:
u'ci -t-"Archived config file." -m"dispatch-conf update."'

diffstatusoutput_mixed

Value:
<portage.dispatch_conf.diff_mixed_wrapper object at 0x7efbee921f50>