from portage import os
from _emerge.Package import Package
from _emerge.PackageVirtualDbapi import PackageVirtualDbapi
+from portage.dbapi.vartree import vartree
if sys.hexversion >= 0x3000000:
long = int
-class FakeVartree(portage.vartree):
+class FakeVartree(vartree):
"""This is implements an in-memory copy of a vartree instance that provides
all the interfaces required for use by the depgraph. The vardb is locked
during the constructor call just long enough to read a copy of the
# $Id$
import sys
-import portage
+from portage.dbapi import dbapi
-class PackageVirtualDbapi(portage.dbapi):
+class PackageVirtualDbapi(dbapi):
"""
A dbapi-like interface class that represents the state of the installed
package database as new packages are installed, replacing any packages
internally (passed in via cpv_inject() and cpv_remove() calls).
"""
def __init__(self, settings):
- portage.dbapi.__init__(self)
+ dbapi.__init__(self)
self.settings = settings
self._match_cache = {}
self._cp_map = {}
result = self._match_cache.get(origdep)
if result is not None:
return result[:]
- result = portage.dbapi.match(self, origdep, use_cache=use_cache)
+ result = dbapi.match(self, origdep, use_cache=use_cache)
self._match_cache[origdep] = result
return result[:]
import portage
from portage import os
from portage import digraph
+from portage.dbapi import dbapi
from portage.dep import Atom
from portage.output import bold, blue, colorize, create_color_func, darkblue, \
darkgreen, green, nc_len, red, teal, turquoise, yellow
def get_runtime_pkg_mask(self):
return self._dynamic_config._runtime_pkg_mask.copy()
-class _dep_check_composite_db(portage.dbapi):
+class _dep_check_composite_db(dbapi):
"""
A dbapi-like interface that is optimized for use in dep_check() calls.
This is built on top of the existing depgraph package selection logic.
via dep_check().
"""
def __init__(self, depgraph, root):
- portage.dbapi.__init__(self)
+ dbapi.__init__(self)
self._depgraph = depgraph
self._root = root
self._match_cache = {}
'portage.data',
'portage.data:lchown,ostype,portage_gid,portage_uid,secpass,' + \
'uid,userland,userpriv_groups,wheelgid',
+ 'portage.dbapi:dbapi',
+ 'portage.dbapi.bintree:bindbapi,binarytree',
+ 'portage.dbapi.porttree:close_portdbapi_caches,FetchlistDict,' + \
+ 'portagetree,portdbapi',
+ 'portage.dbapi.vartree:vardbapi,vartree,dblink',
+ 'portage.dbapi.virtual:fakedbapi',
'portage.dep',
'portage.dep:best_match_to_list,dep_getcpv,dep_getkey,' + \
'flatten,get_operator,isjustname,isspecific,isvalidatom,' + \
]
auxdbkeylen=len(auxdbkeys)
-from portage.dbapi import dbapi
-from portage.dbapi.virtual import fakedbapi
-from portage.dbapi.bintree import bindbapi, binarytree
-from portage.dbapi.vartree import vardbapi, vartree, dblink
-from portage.dbapi.porttree import FetchlistDict, \
- close_portdbapi_caches, portagetree, portdbapi
-
def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None,
vartree=None, prev_mtimes=None, blockers=None):
"""will merge a .tbz2 file, returning a list of runtime dependencies