示例#1
0
 def _async_start(self):
     pr, pw = os.pipe()
     self.fd_pipes = {}
     self.fd_pipes[pw] = pw
     self._async_func_reader_pw = pw
     self._async_func_reader = PipeReader(input_files={"input": pr},
                                          scheduler=self.scheduler)
     self._async_func_reader.addExitListener(self._async_func_reader_exit)
     self._async_func_reader.start()
     yield ForkProcess._async_start(self)
     os.close(pw)
示例#2
0
	def _async_start(self):

		root_config = self.pkg.root_config
		portdb = root_config.trees["porttree"].dbapi
		ebuild_path = self._get_ebuild_path()
		# This is initialized by an earlier _async_uri_map call.
		uri_map = self._uri_map

		if not uri_map:
			# Nothing to fetch.
			self.returncode = os.EX_OK
			self._async_wait()
			return

		settings = self.config_pool.allocate()
		settings.setcpv(self.pkg)
		settings.configdict["pkg"]["SRC_URI"] = self.src_uri
		portage.doebuild_environment(ebuild_path, 'fetch',
			settings=settings, db=portdb)

		if self.prefetch and \
			self._prefetch_size_ok(uri_map, settings, ebuild_path):
			self.config_pool.deallocate(settings)
			self.returncode = os.EX_OK
			self._async_wait()
			return

		nocolor = settings.get("NOCOLOR")

		if self.prefetch:
			settings["PORTAGE_PARALLEL_FETCHONLY"] = "1"

		if self.background:
			nocolor = "true"

		if nocolor is not None:
			settings["NOCOLOR"] = nocolor

		self._settings = settings
		yield ForkProcess._async_start(self)

		# Free settings now since it's no longer needed in
		# this process (the subprocess has a private copy).
		self.config_pool.deallocate(settings)
		settings = None
		self._settings = None
示例#3
0
 def _async_start(self):
     self.addExitListener(self._future_done)
     yield ForkProcess._async_start(self)