From: Zac Medico Date: Sat, 10 Dec 2011 06:23:04 +0000 (-0800) Subject: create_trees: add public eprefix parameter X-Git-Tag: v2.2.0_alpha80~27 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1a171bdd8936fb3b5291dc143e141dfebcee8d9f;p=portage.git create_trees: add public eprefix parameter --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 5a1866ff1..1df956633 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -486,7 +486,8 @@ class _trees_dict(dict): self._running_eroot = None self._target_eroot = None -def create_trees(config_root=None, target_root=None, trees=None, env=None): +def create_trees(config_root=None, target_root=None, trees=None, env=None, + eprefix=portage.const.EPREFIX): if trees is not None: # clean up any existing portdbapi instances for myroot in trees: @@ -504,9 +505,7 @@ def create_trees(config_root=None, target_root=None, trees=None, env=None): if env is None: env = os.environ - eprefix = env.get("__PORTAGE_TEST_EPREFIX") - if eprefix is None: - eprefix = portage.const.EPREFIX + settings = config(config_root=config_root, target_root=target_root, env=env, eprefix=eprefix) settings.lock() diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py index 1a752be8d..cbf42efc3 100644 --- a/pym/portage/tests/resolver/ResolverPlayground.py +++ b/pym/portage/tests/resolver/ResolverPlayground.py @@ -475,7 +475,6 @@ class ResolverPlayground(object): portdir_overlay.append(path) env = { - "__PORTAGE_TEST_EPREFIX": self.eprefix, "ACCEPT_KEYWORDS": "x86", "DISTDIR" : self.distdir, "PKGDIR": os.path.join(self.eroot, "usr/portage/packages"), @@ -491,7 +490,7 @@ class ResolverPlayground(object): if 'PORTAGE_GRPNAME' in os.environ: env['PORTAGE_GRPNAME'] = os.environ['PORTAGE_GRPNAME'] - trees = portage.create_trees(env=env) + trees = portage.create_trees(env=env, eprefix=self.eprefix) for root, root_trees in trees.items(): settings = root_trees["vartree"].settings settings._init_dirs()