public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/
@ 2018-04-29 21:29 99% Zac Medico
  0 siblings, 0 replies; 1+ results
From: Zac Medico @ 2018-04-29 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     542c6e6c20a1d93a3a2af47c8de50eac3c891d5d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 20:48:23 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 21:26:37 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=542c6e6c

MergeProcess: fix deprecated _set_returncode (bug 654276)

Move cleanup code from _set_returncode to _async_waitpid_cb,
since _set_returncode expects an os.waitpid return value which
is inconveniently different from the returncode that is passed to
asyncio.AbstractChildWatcher.add_child_handler callbacks.

Bug: https://bugs.gentoo.org/654276

 pym/portage/dbapi/_MergeProcess.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/pym/portage/dbapi/_MergeProcess.py b/pym/portage/dbapi/_MergeProcess.py
index 35591af16..bfbe387e4 100644
--- a/pym/portage/dbapi/_MergeProcess.py
+++ b/pym/portage/dbapi/_MergeProcess.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import io
@@ -251,8 +251,12 @@ class MergeProcess(ForkProcess):
 				# in order to avoid a race condition.
 				os._exit(1)
 
-	def _set_returncode(self, wait_retval):
-		ForkProcess._set_returncode(self, wait_retval)
+	def _async_waitpid_cb(self, *args, **kwargs):
+		"""
+		Override _async_waitpid_cb to perform cleanup that is
+		not necessarily idempotent.
+		"""
+		ForkProcess._async_waitpid_cb(self, *args, **kwargs)
 		if self.returncode == portage.const.RETURNCODE_POSTINST_FAILURE:
 			self.postinst_failure = True
 			self.returncode = os.EX_OK


^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2018-04-29 21:29 99% [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox