public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/tests/resolver/
@ 2011-10-25  8:09 Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2011-10-25  8:09 UTC (permalink / raw
  To: gentoo-commits

commit:     ebf48235f463e3a79bee13f2dd9a739ddf7faa31
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 25 08:09:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 08:09:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ebf48235

ResolverPlayground: use create_trees

---
 pym/portage/__init__.py                          |    8 +++++---
 pym/portage/tests/resolver/ResolverPlayground.py |   16 +++-------------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index d3df6e3..7f781cf 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -479,7 +479,7 @@ def portageexit():
 	if data.secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
 		close_portdbapi_caches()
 
-def create_trees(config_root=None, target_root=None, trees=None):
+def create_trees(config_root=None, target_root=None, trees=None, env=None):
 	if trees is None:
 		trees = {}
 	else:
@@ -490,9 +490,11 @@ def create_trees(config_root=None, target_root=None, trees=None):
 			portdbapi.portdbapi_instances.remove(portdb)
 			del trees[myroot]["porttree"], myroot, portdb
 
-	eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX")
+	if env is None:
+		env = os.environ
+	eprefix = env.get("__PORTAGE_TEST_EPREFIX")
 	settings = config(config_root=config_root, target_root=target_root,
-		config_incrementals=portage.const.INCREMENTALS, _eprefix=eprefix)
+		env=env, _eprefix=eprefix)
 	settings.lock()
 
 	myroots = [(settings["ROOT"], settings)]

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index ec6f631..4bbd033 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -476,8 +476,10 @@ 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"),
 			"PORTDIR": self.portdir,
 			"PORTDIR_OVERLAY": " ".join(portdir_overlay),
 			'PORTAGE_TMPDIR'       : os.path.join(self.eroot, 'var/tmp'),
@@ -490,19 +492,7 @@ class ResolverPlayground(object):
 		if 'PORTAGE_GRPNAME' in os.environ:
 			env['PORTAGE_GRPNAME'] = os.environ['PORTAGE_GRPNAME']
 
-		settings = config(_eprefix=self.eprefix, env=env)
-		settings.lock()
-
-		trees = {
-			self.root: {
-					"vartree": vartree(settings=settings),
-					"porttree": portagetree(self.root, settings=settings),
-					"bintree": binarytree(self.root,
-						os.path.join(self.eroot, "usr/portage/packages"),
-						settings=settings)
-				}
-			}
-
+		trees = portage.create_trees(env=env)
 		for root, root_trees in trees.items():
 			settings = root_trees["vartree"].settings
 			settings._init_dirs()



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/tests/resolver/
@ 2011-12-10  6:23 Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2011-12-10  6:23 UTC (permalink / raw
  To: gentoo-commits

commit:     1a171bdd8936fb3b5291dc143e141dfebcee8d9f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 06:23:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 06:23:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1a171bdd

create_trees: add public eprefix parameter

---
 pym/portage/__init__.py                          |    7 +++----
 pym/portage/tests/resolver/ResolverPlayground.py |    3 +--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 5a1866f..1df9566 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 1a752be..cbf42ef 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()



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-10  6:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25  8:09 [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/tests/resolver/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2011-12-10  6:23 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox