diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-13 22:02:57 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-13 22:02:57 -0700 |
commit | 67e62aafc4c980909ae85dd6956538fc1e267407 (patch) | |
tree | 46fecd2a352d4d62a0a7a3391fbf22bd78779bea | |
parent | e31a07fdf46118c3e6fb43b703e385a34f5bce08 (diff) | |
download | portage-67e62aafc4c980909ae85dd6956538fc1e267407.tar.gz portage-67e62aafc4c980909ae85dd6956538fc1e267407.tar.bz2 portage-67e62aafc4c980909ae85dd6956538fc1e267407.zip |
Use EbuildBuildDir for PORTAGE_BUILDDIR locking inside doebuild().
-rw-r--r-- | pym/portage/package/ebuild/doebuild.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 3e5587c6f..dff9b881f 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -56,6 +56,7 @@ from portage.util import apply_recursive_permissions, \ from portage.util.lafilefixer import rewrite_lafile from portage.versions import _pkgsplit from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor +from _emerge.EbuildBuildDir import EbuildBuildDir from _emerge.EbuildPhase import EbuildPhase from _emerge.EbuildSpawnProcess import EbuildSpawnProcess from _emerge.PollScheduler import PollScheduler @@ -616,6 +617,10 @@ 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( + dir_path=mysettings['PORTAGE_BUILDDIR'], + scheduler=PollScheduler().sched_iface, settings=mysettings) + builddir_lock.lock() mystatus = prepare_build_dirs(myroot, mysettings, cleanup) if mystatus: return mystatus @@ -809,11 +814,11 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, finally: + if builddir_lock is not None: + builddir_lock.unlock() if tmpdir: mysettings["PORTAGE_TMPDIR"] = tmpdir_orig shutil.rmtree(tmpdir) - if builddir_lock: - portage.locks.unlockdir(builddir_lock) mysettings.pop("REPLACING_VERSIONS", None) |