From c4451a1e94212025e060cfd8e6a2341527202086 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 15 Jan 2011 16:00:35 -0800 Subject: Add PollScheduler.terminate() for interruption. This allows PollScheduler instances to do basic cleanup and terminate gracefully when SIGINT or SIGTERM signals are received. --- pym/_emerge/AbstractEbuildProcess.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pym/_emerge/AbstractEbuildProcess.py') diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 46c8f938f..601aafe0e 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -1,4 +1,4 @@ -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import platform @@ -237,11 +237,12 @@ class AbstractEbuildProcess(SpawnProcess): self.returncode = self._exit_command.exitcode else: self.returncode = 1 - self._unexpected_exit() + if not self.cancelled: + self._unexpected_exit() if self._build_dir is not None: self._build_dir.unlock() self._build_dir = None - else: + elif not self.cancelled: exit_file = self.settings.get('PORTAGE_EBUILD_EXIT_FILE') if exit_file and not os.path.exists(exit_file): self.returncode = 1 -- cgit v1.2.3-1-g7c22