blockers = self.blockers()
mylink = portage.dblink(self.mycat, self.mypkg, settings=self.settings,
treetype=self.treetype, vartree=self.vartree,
- blockers=blockers, scheduler=self.scheduler,
- pipe=elog_writer_fd)
+ blockers=blockers, pipe=elog_writer_fd)
fd_pipes[elog_writer_fd] = elog_writer_fd
self._elog_reg_id = self.scheduler.io_add_watch(elog_reader_fd,
self._registered_events, self._elog_output_handler)
portage.output.havecolor = self.settings.get('NOCOLOR') \
not in ('yes', 'true')
- # In this subprocess we want mylink._display_merge() to use
- # stdout/stderr directly since they are pipes. This behavior
- # is triggered when mylink._scheduler is None.
- mylink._scheduler = None
-
# Avoid wastful updates of the vdb cache.
self.vartree.dbapi._flush_cache_enabled = False
from portage import _encodings
from portage import _unicode_encode
from portage import OrderedDict
+from portage.util._eventloop.EventLoop import EventLoop
from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
-from _emerge.PollScheduler import PollScheduler
import os as _os
import sys
# this purpose because doebuild makes many changes to the config
# instance that is passed in.
self.doebuild_settings = config(clone=self.settings)
- self._scheduler = PollScheduler().sched_iface
+ self._event_loop = EventLoop(main=False)
self.depcachedir = os.path.realpath(self.settings.depcachedir)
if os.environ.get("SANDBOX_ON") == "1":
proc = EbuildMetadataPhase(cpv=mycpv,
ebuild_hash=ebuild_hash, portdb=self,
- repo_path=mylocation, scheduler=self._scheduler,
+ repo_path=mylocation, scheduler=self._event_loop,
settings=self.doebuild_settings)
proc.start()
'portage.util.movefile:movefile',
'portage.util._dyn_libs.PreservedLibsRegistry:PreservedLibsRegistry',
'portage.util._dyn_libs.LinkageMapELF:LinkageMapELF@LinkageMap',
+ 'portage.util._eventloop.EventLoop:EventLoop',
'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,vercmp,' + \
'_pkgsplit@pkgsplit,_pkg_str',
'subprocess',
merge_task = MergeProcess(
mycat=mycat, mypkg=mypkg, settings=settings,
treetype=mytree, vartree=vartree,
- scheduler=(scheduler or PollScheduler().sched_iface),
+ scheduler=(scheduler or EventLoop(main=False)),
background=background, blockers=blockers, pkgloc=pkgloc,
infloc=infloc, myebuild=myebuild, mydbapi=mydbapi,
prev_mtimes=prev_mtimes, logfile=settings.get('PORTAGE_LOG_FILE'))
'portage.dep._slot_operator:evaluate_slot_operator_equal_deps',
'portage.package.ebuild._spawn_nofetch:spawn_nofetch',
'portage.util._desktop_entry:validate_desktop_entry',
+ 'portage.util._eventloop.EventLoop:EventLoop',
'portage.util.ExtractKernelVersion:ExtractKernelVersion'
)
if not returnpid and \
'PORTAGE_BUILDIR_LOCKED' not in mysettings:
builddir_lock = EbuildBuildDir(
- scheduler=PollScheduler().sched_iface,
+ scheduler=EventLoop(main=False),
settings=mysettings)
builddir_lock.lock()
try:
if builddir_lock is None and \
'PORTAGE_BUILDIR_LOCKED' not in mysettings:
builddir_lock = EbuildBuildDir(
- scheduler=PollScheduler().sched_iface,
+ scheduler=EventLoop(main=False),
settings=mysettings)
builddir_lock.lock()
try:
if not returnpid and \
'PORTAGE_BUILDIR_LOCKED' not in mysettings:
builddir_lock = EbuildBuildDir(
- scheduler=PollScheduler().sched_iface,
+ scheduler=EventLoop(main=False),
settings=mysettings)
builddir_lock.lock()
mystatus = prepare_build_dirs(myroot, mysettings, cleanup)
"""
env_extractor = BinpkgEnvExtractor(background=False,
- scheduler=PollScheduler().sched_iface, settings=settings)
+ scheduler=EventLoop(main=False), settings=settings)
if env_extractor.dest_env_exists():
# There are lots of possible states when doebuild()
from portage import _unicode_encode
from portage.const import BASH_BINARY
from portage.tests import TestCase
+from portage.util._eventloop.global_event_loop import global_event_loop
from _emerge.SpawnProcess import SpawnProcess
-from _emerge.PollScheduler import PollScheduler
class SpawnTestCase(TestCase):
os.close(fd)
null_fd = os.open('/dev/null', os.O_RDWR)
test_string = 2 * "blah blah blah\n"
- scheduler = PollScheduler().sched_iface
proc = SpawnProcess(
args=[BASH_BINARY, "-c",
"echo -n '%s'" % test_string],
env={}, fd_pipes={0:sys.stdin.fileno(), 1:null_fd, 2:null_fd},
- scheduler=scheduler,
+ scheduler=global_event_loop(),
logfile=logfile)
proc.start()
os.close(null_fd)
from portage import os
from portage.const import PORTAGE_PYM_PATH
from portage.tests import TestCase
+from portage.util._eventloop.global_event_loop import global_event_loop
-from _emerge.PollScheduler import PollScheduler
from _emerge.PipeReader import PipeReader
from _emerge.SpawnProcess import SpawnProcess
# then the above PYTHONPATH override doesn't help.
env['PORTAGE_PYM_PATH'] = PORTAGE_PYM_PATH
- scheduler = PollScheduler().sched_iface
+ scheduler = global_event_loop()
master_fd, slave_fd = os.pipe()
master_file = os.fdopen(master_fd, 'rb', 0)
slave_file = os.fdopen(slave_fd, 'wb')
from portage import os
from portage import shutil
from portage.tests import TestCase
+from portage.util._eventloop.global_event_loop import global_event_loop
from _emerge.AsynchronousLock import AsynchronousLock
-from _emerge.PollScheduler import PollScheduler
class AsynchronousLockTestCase(TestCase):
def _testAsynchronousLock(self):
- scheduler = PollScheduler().sched_iface
+ scheduler = global_event_loop()
tempdir = tempfile.mkdtemp()
try:
path = os.path.join(tempdir, 'lock_me')
os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"] = prev_state
def _testAsynchronousLockWait(self):
- scheduler = PollScheduler().sched_iface
+ scheduler = global_event_loop()
tempdir = tempfile.mkdtemp()
try:
path = os.path.join(tempdir, 'lock_me')
os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"] = prev_state
def _testAsynchronousLockWaitCancel(self):
- scheduler = PollScheduler().sched_iface
+ scheduler = global_event_loop()
tempdir = tempfile.mkdtemp()
try:
path = os.path.join(tempdir, 'lock_me')
os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"] = prev_state
def _testAsynchronousLockWaitKill(self):
- scheduler = PollScheduler().sched_iface
+ scheduler = global_event_loop()
tempdir = tempfile.mkdtemp()
try:
path = os.path.join(tempdir, 'lock_me')