From 29f070c335bf9dd12f19ab460d02fd5be4e72f59 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Wed, 3 Sep 2008 18:03:57 +0000 Subject: [PATCH] Fix for false sandbox violation alarms by Eren Turkay. BUG:FIXED:2791 --- pisi/operations/build.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pisi/operations/build.py b/pisi/operations/build.py index 8d1354b8..5bd1592a 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -13,6 +13,7 @@ # python standard library import os +import sys import glob import copy import stat @@ -461,8 +462,17 @@ class Builder: valid_paths.append("%s/.ccache" % os.environ["HOME"]) ret = catbox.run(self.actionLocals[func], valid_paths, logger=self.log_sandbox_violation) - if ret.code == 1 or ret.violations != []: + # Retcode can be 0 while there is a sanbox violation, so only look for violations to correctly handle it + if ret.violations != []: + ctx.ui.error(_("Sandbox violation result:")) + for result in ret.violations: + ctx.ui.error("* %s (%s -> %s)" % (result[0], result[1], result[2])) raise Error(_("Sandbox violations!")) + else: + # Retcode is 1 when there is a python exception. + # This is for actionsapi's exceptions. Without this, when exception is raised, build process continues. + if ret.code == 1: + sys.exit(1) else: if mandatory: raise Error(_("unable to call function from actions: %s") % func)