Package portage
[hide private]

Package portage

source code

Submodules [hide private]

Classes [hide private]
  _LazyVersion
  _LegacyGlobalProxy
  _trees_dict
  _unicode_func_wrapper
Wraps a function, converts arguments from unicode to bytes, and return values to unicode from bytes.
  _unicode_module_wrapper
Wraps a module and wraps all functions with _unicode_func_wrapper.
  basestring
str(object='') -> string
  long
int(x=0) -> int or long int(x, base=10) -> int or long
Functions [hide private]
 
_decode_argv(argv) source code
 
_disable_legacy_globals()
This deletes the ObjectProxy instances that are used for lazy initialization of legacy global variables.
source code
 
_eapi_is_deprecated(eapi) source code
 
_get_stdin()
Buggy code in python's multiprocessing/process.py closes sys.stdin and reassigns it to open(os.devnull), but fails to update the corresponding __stdin__ reference.
source code
 
_movefile(src, dest, **kwargs)
Calls movefile and raises a PortageException if an error occurs.
source code
 
_native_kwargs(kwargs) source code
 
_native_string(s, encoding=u'utf_8', errors=u'backslashreplace') source code
 
_parse_eapi_ebuild_head(f) source code
 
_reset_legacy_globals() source code
 
_shell_quote(s)
Quote a string in double-quotes and use backslashes to escape any backslashes, double-quotes, dollar signs, or backquotes in the string.
source code
 
_unicode_decode(s, encoding=u'utf_8', errors=u'replace') source code
 
_unicode_encode(s, encoding=u'utf_8', errors=u'backslashreplace') source code
str
abssymlink(symlink, target=None)
This reads symlinks, resolving the relative symlinks, and returning the absolute.
source code
 
create_trees(config_root=None, target_root=None, trees=None, env=None, eprefix=None) source code
 
eapi_is_supported(eapi) source code
 
getcwd()
this fixes situations where the current directory doesn't exist
source code
 
load_mod(name) source code
 
portageexit() source code
Variables [hide private]
  VERSION = u'2.2.7'
  __package__ = 'portage'
  _bin_path = u'/var/tmp/portage/sys-apps/portage-2.2.7/work/por...
  _comment_or_blank_line = re.compile(r'^\s*(#.*)?$')
  _deprecated_eapis = frozenset([u'3_pre1', u'3_pre2', u'4_pre1'...
  _doebuild_manifest_exempt_depend = 0
  _encodings = {u'content': u'utf_8', u'fs': u'utf_8', u'merge':...
  _internal_caller = False
  _legacy_global_var_names = (u'archlist', u'db', u'features', u...
  _legacy_globals_constructed = set(['archlist', 'db', 'features...
  _os_overrides = {4147133228: <built-in function system>, 41471...
  _pms_eapi_re = re.compile(r'^[ \t]*EAPI=([\'"]?)([A-Za-z0-9\+_...
  _pym_path = u'/var/tmp/portage/sys-apps/portage-2.2.7/work/por...
  _python_interpreter = u'/usr/bin/python2.7'
  _selinux = None
hash(x)
  _selinux_merge = None
hash(x)
  _shell_quote_re = re.compile(r'[\s><=\*\\"\'\$`]')
  _supported_eapis = frozenset(['0', '1', '2', '3', u'3_pre1', u...
  _sync_disabled_warnings = False
  _testing_eapis = frozenset([u'4-python', u'4-slot-abi', u'5-hd...
  _working_copy = False
  archlist = [u'ppc', u'~ppc', u'sparc64-freebsd', u'~sparc64-fr...
  auxdbkeylen = 22
  auxdbkeys = (u'DEPEND', u'RDEPEND', u'SLOT', u'SRC_URI', u'RES...
  bold = <portage.output.create_color_func object at 0x8b0483c>
  bsd_chflags = None
hash(x)
  db = {u'/': {u'virtuals': None, u'bintree': None, u'vartree': ...
  endversion = {u'alpha': -4, u'beta': -3, u'p': 0, u'pre': -2, ...
  endversion_keys = [u'pre', u'p', u'alpha', u'beta', u'rc']
  features = <portage.package.ebuild._config.features_set.featur...
  groups = [u'x86']
  lchown = portage._unicode_func_wrapper(lchown)
  mtimedb = {u'info': {u'/usr/share/gcc-data/i686-pc-linux-gnu/4...
  mtimedbfile = u'/var/cache/edb/mtimedb'
  ostype = 'Linux'
  pickle_write = None
hash(x)
  pkglines = (u'*virtual/dev-manager', u'*virtual/libc', u'*sys-...
  portage_gid = 250
  portage_uid = 250
  portdb = <portage.dbapi.porttree.portdbapi object at 0x8f6888c>
  prelink_capable = 1
  profiledir = u'/etc/portage/make.profile'
  root = u'/'
  secpass = 1
  selinux = None
hash(x)
  selinux_enabled = 0
  settings = <portage.package.ebuild.config.config object at 0x8...
  thirdpartymirrors = {u'3dgamers': [u'ftp://ftp.planetmirror.co...
  uid = 250
  userland = 'GNU'
  userpriv_groups = [250]
  wheelgid = 10
  x = 4

Imports: elog, BASH_BINARY, CACHE_PATH, CONFIG_MEMORY_FILE, CUSTOM_MIRRORS_FILE, CUSTOM_PROFILE_PATH, CacheError, DEPCACHE_PATH, DEPRECATED_PROFILE_FILE, EAPI, EBUILD_SH_BINARY, EBUILD_SH_ENV_FILE, ExtractKernelVersion, FetchlistDict, INCREMENTALS, INVALID_ENV_FILE, LOCALE_DATA_PATH, MAKE_CONF_FILE, MAKE_DEFAULTS_FILE, MISC_SH_BINARY, MODULES_FILE_PATH, MOVE_BINARY, Manifest, MtimeDB, OrderedDict, PORTAGE_BASE_PATH, PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, PRELINK_BINARY, PRIVATE_PATH, PROFILE_PATH, REPO_NAME_FILE, REPO_NAME_LOC, SANDBOX_BINARY, USER_CONFIG_PATH, USER_VIRTUALS_FILE, VDB_PATH, WORLD_FILE, _global_updates, _legacy_globals, _os, _os_merge, _sets, _shutil, apply_recursive_permissions, apply_secpass_permissions, atexit_register, atomic_ofstream, autouse, best, best_from_dict, best_match_to_list, binarytree, bindbapi, cache, cacheddir, catpkgsplit, catsplit, check_config_instance, checksum, close_portdbapi_caches, colorize, config, const, cpv_expand, cpv_getkey, cvstree, data, dbapi, dblink, debug, dep, dep_check, dep_eval, dep_expand, dep_getcpv, dep_getkey, dep_transform, dep_wordreduce, dep_zapdeps, deprecated_profile_check, digestcheck, digestgen, digraph, doebuild, doebuild_environment, dump_traceback, eapi, eclass_cache, emaint, env, env_update, errno, exception, fakedbapi, fetch, fixdbentries, flatten, getCPFromCPV, get_operator, getbinpkg, getconfig, getmaskingreason, getmaskingstatus, grab_updates, grabdict, grabdict_package, grabfile, grabfile_package, isjustname, isspecific, isvalidatom, listdir, localization, lockdir, lockfile, locks, mail, manifest, map_dictlist_vals, match_from_list, match_to_list, merge, movefile, new_protect_filename, news, normalize_path, os, output, package, parse_updates, perform_checksum, perform_md5, pickle_read, pkgcmp, pkgsplit, platform, portagetree, portdbapi, prepare_build_dirs, process, proxy, re, repository, run_exitfuncs, shutil, spawn, spawnebuild, stack_dictlist, stack_dicts, stack_lists, subprocess, sys, time, types, unique_array, unlockdir, unlockfile, unmerge, update, update_config_files, update_dbentries, update_dbentry, util, vardbapi, varexpand, vartree, vercmp, versions, ververify, write_atomic, writedict, writemsg, writemsg_stdout, xml, xpak


Function Details [hide private]

_disable_legacy_globals()

source code 

This deletes the ObjectProxy instances that are used for lazy initialization of legacy global variables. The purpose of deleting them is to prevent new code from referencing these deprecated variables.

_get_stdin()

source code 

Buggy code in python's multiprocessing/process.py closes sys.stdin and reassigns it to open(os.devnull), but fails to update the corresponding __stdin__ reference. So, detect that case and handle it appropriately.

abssymlink(symlink, target=None)

source code 

This reads symlinks, resolving the relative symlinks, and returning the absolute.

Parameters:
  • symlink - path of symlink (must be absolute)
  • target - the target of the symlink (as returned by readlink)
Returns: str
the absolute path of the symlink target

Variables Details [hide private]

_bin_path

Value:
u'/var/tmp/portage/sys-apps/portage-2.2.7/work/portage-2.2.7/bin'

_deprecated_eapis

Value:
frozenset([u'3_pre1', u'3_pre2', u'4_pre1', u'5_pre1', u'5_pre2'])

_encodings

Value:
{u'content': u'utf_8',
 u'fs': u'utf_8',
 u'merge': u'utf_8',
 u'repo.content': u'utf_8',
 u'stdio': u'utf_8'}

_legacy_global_var_names

Value:
(u'archlist',
 u'db',
 u'features',
 u'groups',
 u'mtimedb',
 u'mtimedbfile',
 u'pkglines',
 u'portdb',
...

_legacy_globals_constructed

Value:
set(['archlist',
     'db',
     'features',
     'groups',
     'mtimedb',
     'mtimedbfile',
     'pkglines',
     u'portdb',
...

_os_overrides

Value:
{4147133228: <built-in function system>,
 4147138732: <built-in function popen>,
 4147140268: <built-in function read>,
 4147140396: <built-in function fdopen>,
 4147140556: <built-in function mkfifo>,
 4147141548: <built-in function statvfs>}

_pms_eapi_re

Value:
re.compile(r'^[ \t]*EAPI=([\'"]?)([A-Za-z0-9\+_\.-]*)\1[ \t]*([ \t]#.*\
)?$')

_pym_path

Value:
u'/var/tmp/portage/sys-apps/portage-2.2.7/work/portage-2.2.7/pym'

_supported_eapis

Value:
frozenset(['0',
           '1',
           '2',
           '3',
           u'3_pre1',
           u'3_pre2',
           '4',
           u'4-python',
...

_testing_eapis

Value:
frozenset([u'4-python', u'4-slot-abi', u'5-hdepend', u'5-progress'])

archlist

Value:
[u'ppc',
 u'~ppc',
 u'sparc64-freebsd',
 u'~sparc64-freebsd',
 u'ppc-openbsd',
 u'~ppc-openbsd',
 u'x86-openbsd',
 u'~x86-openbsd',
...

auxdbkeys

Value:
(u'DEPEND',
 u'RDEPEND',
 u'SLOT',
 u'SRC_URI',
 u'RESTRICT',
 u'HOMEPAGE',
 u'LICENSE',
 u'DESCRIPTION',
...

db

Value:
{u'/': {u'virtuals': None, u'bintree': None, u'vartree': <portage.dbap\
i.vartree.vartree object at 0x8750dcc>, u'porttree': <portage.dbapi.po\
rttree.portagetree object at 0x8f7660c>}}

endversion

Value:
{u'alpha': -4, u'beta': -3, u'p': 0, u'pre': -2, u'rc': -1}

features

Value:
<portage.package.ebuild._config.features_set.features_set object at 0x\
8bcdfac>

mtimedb

Value:
{u'info': {u'/usr/share/gcc-data/i686-pc-linux-gnu/4.6.3/info': 137833\
0030, u'/usr/share/info': 1377482245, u'/usr/share/binutils-data/i686-\
pc-linux-gnu/2.22/info': 1369741372, u'/usr/share/binutils-data/i686-p\
c-linux-gnu/2.23.1/info': 1375588757}, u'resume_backup': {u'myopts': {\
u'--complete-graph-if-new-use': u'n', u'--jobs': 4, u'--verbose': True\
, u'--autounmask-unrestricted-atoms': True, u'--load-average': 4.0, u'\
--oneshot': True, u'--package-moves': u'n', u'--ask-enter-invalid': Tr\
ue, u'--complete-graph-if-new-ver': u'n', u'--with-bdeps': u'y', u'--n\
...

pkglines

Value:
(u'*virtual/dev-manager',
 u'*virtual/libc',
 u'*sys-apps/less',
 u'*app-shells/bash',
 u'*sys-apps/texinfo',
 u'*sys-devel/make',
 u'*virtual/service-manager',
 u'*sys-apps/sed',
...

settings

Value:
<portage.package.ebuild.config.config object at 0x89568ac>

thirdpartymirrors

Value:
{u'3dgamers': [u'ftp://ftp.planetmirror.com/pub/3dgamers/games/'],
 u'alsaproject': [u'ftp://ftp.alsa-project.org/pub',
                  u'ftp://ftp.task.gda.pl/pub/linux/misc/alsa/',
                  u'ftp://gd.tuwien.ac.at/opsys/linux/alsa/',
                  u'ftp://ftp.iasi.roedu.net/pub/mirrors/ftp.alsa-proj\
ect.org/',
                  u'http://dl.ambiweb.de/mirrors/ftp.alsa-project.org/\
',
...