From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/tests/resolver/
Date: Tue, 25 Oct 2011 08:09:44 +0000 (UTC) [thread overview]
Message-ID: <ebf48235f463e3a79bee13f2dd9a739ddf7faa31.zmedico@gentoo> (raw)
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()
next reply other threads:[~2011-10-25 8:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-25 8:09 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-12-10 6:23 [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/tests/resolver/ Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ebf48235f463e3a79bee13f2dd9a739ddf7faa31.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox