Make EbuildBuild inherit from EbuildBuildDir since it's going to hold
authorZac Medico <zmedico@gentoo.org>
Fri, 4 Jul 2008 22:39:57 +0000 (22:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 4 Jul 2008 22:39:57 +0000 (22:39 -0000)
the build dir lock while it runs asynchronously.

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

pym/_emerge/__init__.py

index 882b4af35feb27029d7fbebbc021ed693f077743..451e30d2e2327bc1939d781864b176ed345177ce 100644 (file)
@@ -1698,7 +1698,7 @@ class EbuildBuildDir(SlotObject):
        class AlreadyLocked(portage.exception.PortageException):
                pass
 
-class EbuildBuild(SlotObject):
+class EbuildBuild(EbuildBuildDir):
 
        __slots__ = ("args_set", "find_blockers",
                "ldpath_mtimes", "logger", "opts",
@@ -1758,9 +1758,8 @@ class EbuildBuild(SlotObject):
                                        phase="unpack", key=pkg.cpv)
                        return retval
 
-               build_dir = EbuildBuildDir(pkg=pkg, settings=settings)
                try:
-                       build_dir.lock()
+                       self.lock()
                        # Cleaning is triggered before the setup
                        # phase, in portage.doebuild().
                        msg = " === (%s of %s) Cleaning (%s::%s)" % \
@@ -1831,9 +1830,9 @@ class EbuildBuild(SlotObject):
                                if retval != os.EX_OK:
                                        return retval
                finally:
-                       if build_dir.locked:
+                       if self.locked:
                                portage.elog.elog_process(pkg.cpv, settings)
-                               build_dir.unlock()
+                               self.unlock()
                return os.EX_OK
 
 class EbuildExecuter(SlotObject):