In doebuild(), skip PORTAGE_BUILDDIR locking if it's already locked
authorZac Medico <zmedico@gentoo.org>
Wed, 15 Sep 2010 00:20:08 +0000 (17:20 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 15 Sep 2010 00:20:08 +0000 (17:20 -0700)
or returnpid is True.

pym/portage/package/ebuild/doebuild.py

index 4c266222ccdab35179cd2f68c3741a40154a0688..044d66590575cbdd35736a3649641669fe9eb6df 100644 (file)
@@ -617,9 +617,12 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                have_build_dirs = False
                if not parallel_fetchonly and \
                        mydo not in ('digest', 'fetch', 'help', 'manifest'):
-                       builddir_lock = EbuildBuildDir(
-                               scheduler=PollScheduler().sched_iface, settings=mysettings)
-                       builddir_lock.lock()
+                       if not returnpid and \
+                               'PORTAGE_BUILDIR_LOCKED' not in mysettings:
+                               builddir_lock = EbuildBuildDir(
+                                       scheduler=PollScheduler().sched_iface,
+                                       settings=mysettings)
+                               builddir_lock.lock()
                        mystatus = prepare_build_dirs(myroot, mysettings, cleanup)
                        if mystatus:
                                return mystatus