From ffd295fed4ab81fc0bd00bb145ef4d72c49584bf Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 11 Jul 2016 11:07:56 +1200 Subject: devtool: return specific exit code for incompatible recipes Certain recipes cannot be used with devtool extract / modify / upgrade - usually because they don't provide any source. Return a specific exit code (4) so that scripts such as scripts/contrib/devtool-stress.py know the difference between this and a genuine failure. Signed-off-by: Paul Eggleton Signed-off-by: Ross Burton --- scripts/lib/devtool/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts/lib/devtool/__init__.py') diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 77b1fd90a9..65eb4527bc 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -26,10 +26,11 @@ import re logger = logging.getLogger('devtool') - class DevtoolError(Exception): """Exception for handling devtool errors""" - pass + def __init__(self, message, exitcode=1): + super(DevtoolError, self).__init__(message) + self.exitcode = exitcode def exec_build_env_command(init_path, builddir, cmd, watch=False, **options): -- cgit 1.2.3-korg