--- pym/portage.py.orig 2004-02-06 21:01:08.000000000 +0100 +++ pym/portage.py 2004-02-07 03:22:19.241512238 +0100 @@ -1110,7 +1110,7 @@ aumtime=0 -def autouse(myvartree): +def autouse(myvartree,use_cache=1): "returns set of USE variables auto-enabled due to packages being installed" global usedefaults if profiledir==None: @@ -1119,7 +1119,7 @@ for myuse in usedefaults: mydep = string.join(usedefaults[myuse]) #check dependencies; tell depcheck() to ignore settings["USE"] since we are still forming it. - myresult=dep_check(mydep,myvartree.dbapi,None,use="no") + myresult=dep_check(mydep,myvartree.dbapi,None,use="no",use_cache=use_cache) if myresult[0]==1 and not myresult[1]: #deps satisfied, add USE variable... myusevars=myusevars+" "+myuse @@ -1314,7 +1314,7 @@ else: raise KeyError, "No such key defined in environment: %s" % key - def reset(self,keeping_pkg=0): + def reset(self,keeping_pkg=0,use_cache=1): "reset environment to original settings" for x in self.configlist[-1].keys(): if x not in self.backupenv.keys(): @@ -1327,7 +1327,7 @@ if not keeping_pkg: for x in self.configdict["pkg"].keys(): del self.configdict["pkg"][x] - self.regenerate() + self.regenerate(use_cache=use_cache) def load_infodir(self,infodir): if self.configdict.has_key("pkg"): @@ -1357,7 +1357,7 @@ return 1 return 0 - def setcpv(self,mycpv): + def setcpv(self,mycpv,use_cache=1): self.modifying() self.mycpv = mycpv self.pusekey = best_match_to_list(self.mycpv, self.pusedict.keys()) @@ -1367,9 +1367,9 @@ self.puse = "" self.configdict["pkg"]["PKGUSE"] = self.puse[:] # For saving to PUSE file self.configdict["pkg"]["USE"] = self.puse[:] # this gets appended to USE - self.reset(keeping_pkg=1) + self.reset(keeping_pkg=1,use_cache=use_cache) - def regenerate(self,useonly=0): + def regenerate(self,useonly=0,use_cache=1): global incrementals,usesplit,profiledir if useonly: @@ -1381,7 +1381,7 @@ mydbs=self.uvlist # XXX Global usage of db... Needs to go away somehow. if db.has_key(root) and db[root].has_key("vartree"): - self.configdict["auto"]["USE"]=autouse(db[root]["vartree"]) + self.configdict["auto"]["USE"]=autouse(db[root]["vartree"],use_cache=use_cache) else: self.configdict["auto"]["USE"]="" else: @@ -2048,7 +2048,7 @@ actionmap[mydo]["args"][0], actionmap[mydo]["args"][1]) -def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None): +def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,use_cache=1): global db ebuild_path = os.path.abspath(myebuild) @@ -2062,8 +2062,8 @@ writemsg("!!! Error: PF is null '%s'; exiting.\n" % mypv) return 1 - mysettings.reset() - mysettings.setcpv(mycpv) + mysettings.reset(use_cache=use_cache) + mysettings.setcpv(mycpv,use_cache=use_cache) if mydo not in ["help","clean","prerm","postrm","preinst","postinst", "config","touch","setup","depend","fetch","digest", @@ -3249,7 +3249,7 @@ mydep=mydep[1:] return prefix+cpv_expand(mydep,mydb,use_cache=use_cache)+postfix -def dep_check(depstring,mydbapi,mysettings,use="yes",mode=None,myuse=None): +def dep_check(depstring,mydbapi,mysettings,use="yes",mode=None,myuse=None,use_cache=1): """Takes a depend string and parses the condition.""" #check_config_instance(mysettings) @@ -3284,14 +3284,14 @@ mysplit=dep_virtual(mysplit) #if mysplit==None, then we have a parse error (paren mismatch or misplaced ||) #up until here, we haven't needed to look at the database tree - + if mysplit==None: return [0,"Parse Error (parentheses mismatch?)"] elif mysplit==[]: #dependencies were reduced to nothing return [1,[]] mysplit2=mysplit[:] - mysplit2=dep_wordreduce(mysplit2,mydbapi,mode) + mysplit2=dep_wordreduce(mysplit2,mydbapi,mode,use_cache=use_cache) if mysplit2==None: return [0,"Invalid token"] myeval=dep_eval(mysplit2) @@ -3305,21 +3305,21 @@ mydict[x]=1 return [1,mydict.keys()] -def dep_wordreduce(mydeplist,mydbapi,mode): +def dep_wordreduce(mydeplist,mydbapi,mode,use_cache=1): "Reduces the deplist to ones and zeros" mypos=0 deplist=mydeplist[:] while mypos=1) if deplist[mypos][0]=="!": @@ -5232,7 +5232,7 @@ #do prerm script if myebuildpath and os.path.exists(myebuildpath): - a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup) + a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup,use_cache=0) # XXX: Decide how to handle failures here. if a != 0: writemsg("!!! FAILED prerm: "+str(a)+"\n") @@ -5449,7 +5449,7 @@ if myebuildpath and os.path.exists(myebuildpath): # XXX: This should be the old config, not the current one. # XXX: Use vardbapi to load up env vars. - a=doebuild(myebuildpath,"postrm",self.myroot,self.settings) + a=doebuild(myebuildpath,"postrm",self.myroot,self.settings,use_cache=0) # XXX: Decide how to handle failures here. if a != 0: writemsg("!!! FAILED postrm: "+str(a)+"\n") @@ -5485,9 +5485,9 @@ if myebuild: # if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg # (if any). - a=doebuild(myebuild,"preinst",root,self.settings,cleanup=cleanup) + a=doebuild(myebuild,"preinst",root,self.settings,cleanup=cleanup,use_cache=0) else: - a=doebuild(inforoot+"/"+self.pkg+".ebuild","preinst",root,self.settings,cleanup=cleanup) + a=doebuild(inforoot+"/"+self.pkg+".ebuild","preinst",root,self.settings,cleanup=cleanup,use_cache=0) # XXX: Decide how to handle failures here. if a != 0: @@ -5609,9 +5609,9 @@ if myebuild: # if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg # (if any). - a=doebuild(myebuild,"postinst",root,self.settings) + a=doebuild(myebuild,"postinst",root,self.settings,use_cache=0) else: - a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings) + a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings,use_cache=0) # XXX: Decide how to handle failures here. if a != 0: