From dfc634ab5f36b6b098bd48651f9a338b473f01e8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 19 Sep 2010 17:55:27 -0700 Subject: [PATCH] Optimize ResolverPlayground._create_ebuild_manifests() to use a single config instance, and call digestgen() directly. --- pym/portage/tests/resolver/ResolverPlayground.py | 11 ++++++----- 1 file 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: -- 2.26.2