From ec0c489dc259ee896f074c64a01c84d09310ddb4 Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Sun, 18 Dec 2005 14:02:41 +0000 Subject: [PATCH] Quick hack to work around the extra package lookups in porttree when checking for issues in the world file. This restores the number of lookups to be equal with xcreate before it was refactored. Further refactoring will improve style. svn path=/main/trunk/; revision=2398 --- bin/emerge | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/bin/emerge b/bin/emerge index 89dc9089f..087d1d682 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1180,7 +1180,7 @@ class depgraph: if curslot == myslot: return match - def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None): + def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None,raise_on_missing=False): "given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure" if "--debug" in myopts: print @@ -1262,6 +1262,8 @@ class depgraph: break if (not myeb) and (not myeb_pkg): + if raise_on_missing: + raise ValueError if not arg: xinfo='"'+x+'"' else: @@ -1397,6 +1399,7 @@ class depgraph: def xcreate(self,mode="system"): global syslist + world_problems = False if mode=="system": mylist=syslist else: @@ -1405,27 +1408,30 @@ class depgraph: sysdict=genericdict(syslist) worlddict=genericdict(worldlist) - world_problems = False for x in worlddict.keys(): if not portage.isvalidatom(x): world_problems = True elif not portage.db["/"]["vartree"].dbapi.match(x): world_problems = True - elif not portage.db["/"]["porttree"].dbapi.match(x): - world_problems = True else: sysdict[x]=worlddict[x] - if world_problems: - print "\n!!! Problems have been detected with your world file" - print "!!! Please run "+green("emaint --check world")+"\n" - del world_problems mylist = sysdict.keys() for mydep in mylist: - if not self.select_dep(portage.root, mydep): - print "\n\n!!! Problem resolving dependencies for", mydep - return 0 + try: + if not self.select_dep(portage.root, mydep, raise_on_missing=True): + print "\n\n!!! Problem resolving dependencies for", mydep + return 0 + except ValueError: + if "--debug" in myopts: + raise + world_problems = True + + if world_problems: + print "\n!!! Problems have been detected with your world file" + print "!!! Please run "+green("emaint --check world")+"\n" + return 1 def match(self,mydep,myroot=portage.root,mykey=None): -- 2.26.2