When calling doebuild() to spawn the 'depend' phase, just call config.setcpv()
authorZac Medico <zmedico@gentoo.org>
Mon, 23 Mar 2009 05:49:17 +0000 (05:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 23 Mar 2009 05:49:17 +0000 (05:49 -0000)
since that should be enough (no need for separate reset or reload calls).

svn path=/main/trunk/; revision=13170

pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/porttree.py

index bee4dc5a0634f7f031efcab7e57af6f6858f7911..17fec42d1431f8543a83c42eaf2bbc2f77ce51b3 100644 (file)
@@ -3027,7 +3027,7 @@ class EbuildMetadataPhase(SubProcess):
 
        def _start(self):
                settings = self.settings
-               settings.reset()
+               settings.setcpv(self.cpv)
                ebuild_path = self.ebuild_path
                debug = settings.get("PORTAGE_DEBUG") == "1"
                master_fd = None
index 21f671b436e9d832ff4a6c37d56f6260bcd10306..f56c64471d4617b5ee10717a5d8afca6091b7897 100644 (file)
@@ -5045,14 +5045,14 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m
        tmpdir = mysettings["PORTAGE_TMPDIR"]
 
        if mycpv != mysettings.mycpv:
-               # Reload env.d variables and reset any previous settings.
-               mysettings.reload()
-               mysettings.reset()
                if mydo == 'depend':
                        # Don't pass in mydbapi here since the resulting aux_get
                        # call would lead to infinite 'depend' phase recursion.
                        mysettings.setcpv(mycpv)
                else:
+                       # Reload env.d variables and reset any previous settings.
+                       mysettings.reload()
+                       mysettings.reset()
                        mysettings.setcpv(mycpv, mydb=mydbapi)
 
        # config.reset() might have reverted a change made by the caller,
index 93730e9c333a4d6f98b008f7be2294566cdf7df2..077715239aadbe4b3217f129d27c1eb55c34e815 100644 (file)
@@ -417,7 +417,7 @@ class portdbapi(dbapi):
                        writemsg("doregen: %s %s\n" % (doregen, mycpv), 2)
                        writemsg("Generating cache entry(0) for: "+str(myebuild)+"\n", 1)
 
-                       self.doebuild_settings.reset()
+                       self.doebuild_settings.setcpv(mycpv)
                        mydata = {}
                        myret = doebuild(myebuild, "depend",
                                self.doebuild_settings["ROOT"], self.doebuild_settings,