summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-15 15:13:07 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:50 +0000
commitddf2c687d8620494f6e994d2d2b1835d605b6258 (patch)
treea9236631c0d240d8e658675156e6671133c5c396 /bitbake
parent3d51fd2b7d5a0838053db1df3f1e0234ee306411 (diff)
downloadopenembedded-core-contrib-ddf2c687d8620494f6e994d2d2b1835d605b6258.tar.gz
process: handle OSErrors other than file not found
(Bitbake rev: 7d80a5355cb540aae8d3082c1efebb72da4f93c6) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/process.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/process.py b/bitbake/lib/bb/process.py
index f02332df9a..dc97e3f72f 100644
--- a/bitbake/lib/bb/process.py
+++ b/bitbake/lib/bb/process.py
@@ -10,8 +10,9 @@ def subprocess_setup():
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
class CmdError(RuntimeError):
- def __init__(self, command):
+ def __init__(self, command, message=None):
self.command = command
+ self.message = message
def __str__(self):
if not isinstance(self.command, basestring):
@@ -19,7 +20,10 @@ class CmdError(RuntimeError):
else:
cmd = self.command
- return "Execution of '%s' failed" % cmd
+ msg = "Execution of '%s' failed" % cmd
+ if self.message:
+ msg += ': %s' % self.message
+ return msg
class NotFoundError(CmdError):
def __str__(self):
@@ -94,7 +98,7 @@ def run(cmd, input=None, **options):
if exc.errno == 2:
raise NotFoundError(cmd)
else:
- raise
+ raise CmdError(cmd, exc)
if log:
stdout, stderr = _logged_communicate(pipe, log, input)