From 57420c1510d433f5d6b3edb5cb6543f2d684a90f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 29 Jun 2006 04:18:10 +0000 Subject: [PATCH] Pass a config instance into the vardbapi constructor so that it doesn't have to rely on global settings. svn path=/main/trunk/; revision=3688 --- pym/portage.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index f391f0ba8..4393176c9 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -4258,7 +4258,7 @@ class bindbapi(fakedbapi): cptot=0 class vardbapi(dbapi): - def __init__(self,root,categories=None): + def __init__(self, root, categories=None, settings=None): self.root = root[:] #cache for category directory mtimes self.mtdircache = {} @@ -4267,8 +4267,10 @@ class vardbapi(dbapi): #cache for cp_list results self.cpcache = {} self.blockers = None + if settings is None: + settings = globals()["settings"] + self.settings = settings if categories is None: - global settings categories = settings.categories self.categories = categories[:] @@ -4488,7 +4490,8 @@ class vardbapi(dbapi): def match(self,origdep,use_cache=1): "caching match function" - mydep=dep_expand(origdep,mydb=self,use_cache=use_cache) + mydep = dep_expand( + origdep, mydb=self, use_cache=use_cache, settings=self.settings) mykey=dep_getkey(mydep) mycat=mykey.split("/")[0] if not use_cache: -- 2.26.2