From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QUhyy-0002pQ-E0 for garchives@archives.gentoo.org; Thu, 09 Jun 2011 16:21:24 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 31E9B1C0F3; Thu, 9 Jun 2011 16:21:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id F2F341C0F3 for ; Thu, 9 Jun 2011 16:21:12 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 82D7A2AC00C for ; Thu, 9 Jun 2011 16:21:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A32CC8003C for ; Thu, 9 Jun 2011 16:21:11 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/AbstractEbuildProcess.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: ab6d03f3813318f9ba49e75a52d42972e14cdcc7 Date: Thu, 9 Jun 2011 16:21:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: f4e584671e87f56f19deea39978f309d commit: ab6d03f3813318f9ba49e75a52d42972e14cdcc7 Author: Zac Medico gentoo org> AuthorDate: Thu Jun 9 16:19:33 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Jun 9 16:19:33 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dab6d03f3 AbstractEbuildProcess: handle kill by signal This will fix bug #368817. --- pym/_emerge/AbstractEbuildProcess.py | 24 +++++++++++++++++++----- 1 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractE= buildProcess.py index 39c613b..4348788 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -181,6 +181,11 @@ class AbstractEbuildProcess(SpawnProcess): return not ('sesandbox' in self.settings.features \ and self.settings.selinux_enabled()) or os.isatty(slave_fd) =20 + def _killed_by_signal(self, signum): + msg =3D _("The ebuild phase '%s' has been " + "killed by signal %s.") % (self.phase, signum) + self._eerror(textwrap.wrap(msg, 72)) + def _unexpected_exit(self): =20 phase =3D self.phase @@ -243,14 +248,23 @@ class AbstractEbuildProcess(SpawnProcess): if self._exit_command.exitcode is not None: self.returncode =3D self._exit_command.exitcode else: - self.returncode =3D 1 - if not self.cancelled: - self._unexpected_exit() + if self.returncode < 0: + if not self.cancelled: + self._killed_by_signal(-self.returncode) + else: + self.returncode =3D 1 + if not self.cancelled: + self._unexpected_exit() if self._build_dir is not None: self._build_dir.unlock() self._build_dir =3D None elif not self.cancelled: exit_file =3D self.settings.get('PORTAGE_EBUILD_EXIT_FILE') if exit_file and not os.path.exists(exit_file): - self.returncode =3D 1 - self._unexpected_exit() + if self.returncode < 0: + if not self.cancelled: + self._killed_by_signal(-self.returncode) + else: + self.returncode =3D 1 + if not self.cancelled: + self._unexpected_exit()