summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-19 17:55:27 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-19 17:55:27 -0700
commitdfc634ab5f36b6b098bd48651f9a338b473f01e8 (patch)
tree1d2bb220ef0d22f150cb1ce1488e993ec25e98ba
parent213dce575a3302ea3b24a81382a587533fd665e1 (diff)
downloadportage-dfc634ab5f36b6b098bd48651f9a338b473f01e8.tar.gz
portage-dfc634ab5f36b6b098bd48651f9a338b473f01e8.tar.bz2
portage-dfc634ab5f36b6b098bd48651f9a338b473f01e8.zip
Optimize ResolverPlayground._create_ebuild_manifests() to use a single
config instance, and call digestgen() directly.
-rw-r--r--pym/portage/tests/resolver/ResolverPlayground.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index f05bdf184..8d2a9fd3b 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -12,6 +12,7 @@ from portage.dbapi.porttree import portagetree
from portage.dbapi.bintree import binarytree
from portage.dep import Atom, _repo_separator
from portage.package.ebuild.config import config
+from portage.package.ebuild.digestgen import digestgen
from portage._sets import load_default_config
from portage.versions import catsplit
@@ -139,6 +140,8 @@ class ResolverPlayground(object):
f.close()
def _create_ebuild_manifests(self, ebuilds):
+ tmpsettings = config(clone=self.settings)
+ tmpsettings['PORTAGE_QUIET'] = '1'
for cpv in ebuilds:
a = Atom("=" + cpv, allow_repo=True)
repo = a.repo
@@ -149,12 +152,10 @@ class ResolverPlayground(object):
ebuild_dir = os.path.join(repo_dir, a.cp)
ebuild_path = os.path.join(ebuild_dir, a.cpv.split("/")[1] + ".ebuild")
- portage.util.noiselimit = -1
- tmpsettings = config(clone=self.settings)
portdb = self.trees[self.root]["porttree"].dbapi
- portage.doebuild(ebuild_path, "digest", self.root, tmpsettings,
- tree="porttree", mydbapi=portdb)
- portage.util.noiselimit = 0
+ tmpsettings['O'] = ebuild_dir
+ if not digestgen(mysettings=tmpsettings, myportdb=portdb):
+ raise AssertionError('digest creation failed for %s' % ebuild_path)
def _create_installed(self, installed):
for cpv in installed: