From 601fc103087bcecf46d34d26aad5a939a1cb087c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 3 May 2015 14:15:01 -0700 Subject: Scheduler: increase visiblity of postinst failures (bug 547778) This makes postinst failures behave more like "real" failures in terms of output and the final emerge return code. However, in other respects, these packages will be treated as successful installations. This means that they will not cause emerge to immediately exit, and they will not trigger recalculation of dependencies when --keep-going is enabled. X-Gentoo-Bug: 547778 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=547778 Acked-by: Brian Dolbec --- pym/portage/dbapi/vartree.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pym/portage/dbapi/vartree.py') diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index fca84d1b1..a2fb325c3 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1577,6 +1577,7 @@ class dblink(object): self._hash_key = (self._eroot, self.mycpv) self._protect_obj = None self._pipe = pipe + self._postinst_failure = False # When necessary, this attribute is modified for # compliance with RESTRICT=preserve-libs. @@ -4376,6 +4377,7 @@ class dblink(object): if a != os.EX_OK: # It's stupid to bail out here, so keep going regardless of # phase return code. + self._postinst_failure = True self._elog("eerror", "postinst", [ _("FAILED postinst: %s") % (a,), ]) @@ -5042,6 +5044,10 @@ class dblink(object): self.vartree.dbapi._bump_mtime(self.mycpv) if not parallel_install: self.unlockdb() + + if retval == os.EX_OK and self._postinst_failure: + retval = portage.const.RETURNCODE_POSTINST_FAILURE + return retval def getstring(self,name): -- cgit v1.2.3-65-gdbad