# Some kernels, such as Solaris, return EINVAL when an attempt
# is made to remove the current working directory.
cd "$PORTAGE_BUILDDIR"/../..
- rmdir "$PORTAGE_BUILDDIR" "${PORTAGE_BUILDDIR%/*}" 2>/dev/null
+ rmdir "$PORTAGE_BUILDDIR" 2>/dev/null
true
}
use_cache, mydbapi)
if mydo in clean_phases:
- return _spawn_phase(mydo, mysettings,
- fd_pipes=fd_pipes, returnpid=returnpid)
+ builddir_lock = None
+ if not returnpid and \
+ 'PORTAGE_BUILDIR_LOCKED' not in mysettings:
+ builddir_lock = EbuildBuildDir(
+ scheduler=PollScheduler().sched_iface,
+ settings=mysettings)
+ builddir_lock.lock()
+ try:
+ return _spawn_phase(mydo, mysettings,
+ fd_pipes=fd_pipes, returnpid=returnpid)
+ finally:
+ if builddir_lock is not None:
+ builddir_lock.unlock()
restrict = set(mysettings.get('PORTAGE_RESTRICT', '').split())
# get possible slot information from the deps file