Make Binpkg call doebuild_environment() before constructing
authorZac Medico <zmedico@gentoo.org>
Tue, 14 Sep 2010 14:37:11 +0000 (07:37 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 14 Sep 2010 14:37:11 +0000 (07:37 -0700)
EbuildBuildDir, so PORTAGE_BUILDDIR is initialized first.

pym/_emerge/Binpkg.py

index d93ea65ccd12e04d2ecb2c8d6082c37e7c9331d2..16826df2de5dae1a8718b6d08d4bb3ceff84df96 100644 (file)
@@ -41,15 +41,17 @@ class Binpkg(CompositeTask):
 
                dir_path = os.path.join(settings["PORTAGE_TMPDIR"],
                        "portage", pkg.category, pkg.pf)
-               self._build_dir = EbuildBuildDir(dir_path=dir_path,
-                       scheduler=self.scheduler, settings=settings)
                self._image_dir = os.path.join(dir_path, "image")
                self._infloc = os.path.join(dir_path, "build-info")
                self._ebuild_path = os.path.join(self._infloc, pkg.pf + ".ebuild")
                settings["EBUILD"] = self._ebuild_path
-               debug = settings.get("PORTAGE_DEBUG") == "1"
-               portage.doebuild_environment(self._ebuild_path, "setup",
-                       settings["ROOT"], settings, debug, 1, self._bintree.dbapi)
+               portage.doebuild_environment(self._ebuild_path, 'setup',
+                       settings=self.settings, db=self._bintree.dbapi)
+               if dir_path != self.settings['PORTAGE_BUILDDIR']:
+                       raise AssertionError("'%s' != '%s'" % \
+                               (dir_path, self.settings['PORTAGE_BUILDDIR']))
+               self._build_dir = EbuildBuildDir(dir_path=dir_path,
+                       scheduler=self.scheduler, settings=settings)
                settings.configdict["pkg"]["EMERGE_FROM"] = pkg.type_name
 
                # The prefetcher has already completed or it