本文整理汇总了Python中_emerge.SpawnProcess.SpawnProcess._set_returncode方法的典型用法代码示例。如果您正苦于以下问题:Python SpawnProcess._set_returncode方法的具体用法?Python SpawnProcess._set_returncode怎么用?Python SpawnProcess._set_returncode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_emerge.SpawnProcess.SpawnProcess
的用法示例。
在下文中一共展示了SpawnProcess._set_returncode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _set_returncode
# 需要导入模块: from _emerge.SpawnProcess import SpawnProcess [as 别名]
# 或者: from _emerge.SpawnProcess.SpawnProcess import _set_returncode [as 别名]
def _set_returncode(self, wait_retval):
SpawnProcess._set_returncode(self, wait_retval)
if self._exit_timeout_id is not None:
self.scheduler.source_remove(self._exit_timeout_id)
self._exit_timeout_id = None
if self._ipc_daemon is not None:
self._ipc_daemon.cancel()
if self._exit_command.exitcode is not None:
self.returncode = self._exit_command.exitcode
else:
if self.returncode < 0:
if not self.cancelled:
self._killed_by_signal(-self.returncode)
else:
self.returncode = 1
if not self.cancelled:
self._unexpected_exit()
if self._build_dir is not None:
self._build_dir.unlock()
self._build_dir = None
elif not self.cancelled:
exit_file = self.settings.get('PORTAGE_EBUILD_EXIT_FILE')
if exit_file and not os.path.exists(exit_file):
if self.returncode < 0:
if not self.cancelled:
self._killed_by_signal(-self.returncode)
else:
self.returncode = 1
if not self.cancelled:
self._unexpected_exit()
示例2: _set_returncode
# 需要导入模块: from _emerge.SpawnProcess import SpawnProcess [as 别名]
# 或者: from _emerge.SpawnProcess.SpawnProcess import _set_returncode [as 别名]
def _set_returncode(self, wait_retval):
SpawnProcess._set_returncode(self, wait_retval)
if self.returncode == os.EX_OK:
# If possible, update the mtime to match the remote package if
# the fetcher didn't already do it automatically.
bintree = self.pkg.root_config.trees["bintree"]
if bintree._remote_has_index:
remote_mtime = bintree._remotepkgs[self.pkg.cpv].get("MTIME")
if remote_mtime is not None:
try:
remote_mtime = long(remote_mtime)
except ValueError:
pass
else:
try:
local_mtime = os.stat(self.pkg_path)[stat.ST_MTIME]
except OSError:
pass
else:
if remote_mtime != local_mtime:
try:
os.utime(self.pkg_path,
(remote_mtime, remote_mtime))
except OSError:
pass
if self.locked:
self.unlock()
示例3: _set_returncode
# 需要导入模块: from _emerge.SpawnProcess import SpawnProcess [as 别名]
# 或者: from _emerge.SpawnProcess.SpawnProcess import _set_returncode [as 别名]
def _set_returncode(self, wait_retval):
SpawnProcess._set_returncode(self, wait_retval)
# Collect elog messages that might have been
# created by the pkg_nofetch phase.
if self._build_dir is not None:
# Skip elog messages for prefetch, in order to avoid duplicates.
if not self.prefetch and self.returncode != os.EX_OK:
elog_out = None
if self.logfile is not None:
if self.background:
elog_out = codecs.open(_unicode_encode(self.logfile,
encoding=_encodings['fs'], errors='strict'),
mode='a', encoding=_encodings['content'], errors='replace')
msg = "Fetch failed for '%s'" % (self.pkg.cpv,)
if self.logfile is not None:
msg += ", Log file:"
eerror(msg, phase="unpack", key=self.pkg.cpv, out=elog_out)
if self.logfile is not None:
eerror(" '%s'" % (self.logfile,),
phase="unpack", key=self.pkg.cpv, out=elog_out)
if elog_out is not None:
elog_out.close()
if not self.prefetch:
portage.elog.elog_process(self.pkg.cpv, self._build_dir.settings)
features = self._build_dir.settings.features
if self.returncode == os.EX_OK:
self._build_dir.clean_log()
self._build_dir.unlock()
self.config_pool.deallocate(self._build_dir.settings)
self._build_dir = None
示例4: _set_returncode
# 需要导入模块: from _emerge.SpawnProcess import SpawnProcess [as 别名]
# 或者: from _emerge.SpawnProcess.SpawnProcess import _set_returncode [as 别名]
def _set_returncode(self, wait_retval):
SpawnProcess._set_returncode(self, wait_retval)
# Collect elog messages that might have been
# created by the pkg_nofetch phase.
# Skip elog messages for prefetch, in order to avoid duplicates.
if not self.prefetch and self.returncode != os.EX_OK:
msg_lines = []
msg = "Fetch failed for '%s'" % (self.pkg.cpv,)
if self.logfile is not None:
msg += ", Log file:"
msg_lines.append(msg)
if self.logfile is not None:
msg_lines.append(" '%s'" % (self.logfile,))
self._eerror(msg_lines)
示例5: _set_returncode
# 需要导入模块: from _emerge.SpawnProcess import SpawnProcess [as 别名]
# 或者: from _emerge.SpawnProcess.SpawnProcess import _set_returncode [as 别名]
def _set_returncode(self, wait_retval):
SpawnProcess._set_returncode(self, wait_retval)
if self._ipc_daemon is not None:
self._ipc_daemon.cancel()
if self._exit_command.exitcode is not None:
self.returncode = self._exit_command.exitcode
else:
self.returncode = 1
self._unexpected_exit()
else:
exit_file = self.settings.get('PORTAGE_EBUILD_EXIT_FILE')
if exit_file and not os.path.exists(exit_file):
self.returncode = 1
self._unexpected_exit()