diff options
Diffstat (limited to 'scripts/lib')
| -rw-r--r-- | scripts/lib/devtool/__init__.py | 5 | ||||
| -rw-r--r-- | scripts/lib/devtool/standard.py | 16 |
2 files changed, 12 insertions, 9 deletions
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 | |||
| 26 | 26 | ||
| 27 | logger = logging.getLogger('devtool') | 27 | logger = logging.getLogger('devtool') |
| 28 | 28 | ||
| 29 | |||
| 30 | class DevtoolError(Exception): | 29 | class DevtoolError(Exception): |
| 31 | """Exception for handling devtool errors""" | 30 | """Exception for handling devtool errors""" |
| 32 | pass | 31 | def __init__(self, message, exitcode=1): |
| 32 | super(DevtoolError, self).__init__(message) | ||
| 33 | self.exitcode = exitcode | ||
| 33 | 34 | ||
| 34 | 35 | ||
| 35 | def exec_build_env_command(init_path, builddir, cmd, watch=False, **options): | 36 | def exec_build_env_command(init_path, builddir, cmd, watch=False, **options): |
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 5be4d26b29..645a61f25b 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -264,28 +264,30 @@ def _check_compatible_recipe(pn, d): | |||
| 264 | """Check if the recipe is supported by devtool""" | 264 | """Check if the recipe is supported by devtool""" |
| 265 | if pn == 'perf': | 265 | if pn == 'perf': |
| 266 | raise DevtoolError("The perf recipe does not actually check out " | 266 | raise DevtoolError("The perf recipe does not actually check out " |
| 267 | "source and thus cannot be supported by this tool") | 267 | "source and thus cannot be supported by this tool", |
| 268 | 4) | ||
| 268 | 269 | ||
| 269 | if pn in ['kernel-devsrc', 'package-index'] or pn.startswith('gcc-source'): | 270 | if pn in ['kernel-devsrc', 'package-index'] or pn.startswith('gcc-source'): |
| 270 | raise DevtoolError("The %s recipe is not supported by this tool" % pn) | 271 | raise DevtoolError("The %s recipe is not supported by this tool" % pn, 4) |
| 271 | 272 | ||
| 272 | if bb.data.inherits_class('image', d): | 273 | if bb.data.inherits_class('image', d): |
| 273 | raise DevtoolError("The %s recipe is an image, and therefore is not " | 274 | raise DevtoolError("The %s recipe is an image, and therefore is not " |
| 274 | "supported by this tool" % pn) | 275 | "supported by this tool" % pn, 4) |
| 275 | 276 | ||
| 276 | if bb.data.inherits_class('populate_sdk', d): | 277 | if bb.data.inherits_class('populate_sdk', d): |
| 277 | raise DevtoolError("The %s recipe is an SDK, and therefore is not " | 278 | raise DevtoolError("The %s recipe is an SDK, and therefore is not " |
| 278 | "supported by this tool" % pn) | 279 | "supported by this tool" % pn, 4) |
| 279 | 280 | ||
| 280 | if bb.data.inherits_class('packagegroup', d): | 281 | if bb.data.inherits_class('packagegroup', d): |
| 281 | raise DevtoolError("The %s recipe is a packagegroup, and therefore is " | 282 | raise DevtoolError("The %s recipe is a packagegroup, and therefore is " |
| 282 | "not supported by this tool" % pn) | 283 | "not supported by this tool" % pn, 4) |
| 283 | 284 | ||
| 284 | if bb.data.inherits_class('meta', d): | 285 | if bb.data.inherits_class('meta', d): |
| 285 | raise DevtoolError("The %s recipe is a meta-recipe, and therefore is " | 286 | raise DevtoolError("The %s recipe is a meta-recipe, and therefore is " |
| 286 | "not supported by this tool" % pn) | 287 | "not supported by this tool" % pn, 4) |
| 287 | 288 | ||
| 288 | if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC', True): | 289 | if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC', True): |
| 290 | # Not an incompatibility error per se, so we don't pass the error code | ||
| 289 | raise DevtoolError("externalsrc is currently enabled for the %s " | 291 | raise DevtoolError("externalsrc is currently enabled for the %s " |
| 290 | "recipe. This prevents the normal do_patch task " | 292 | "recipe. This prevents the normal do_patch task " |
| 291 | "from working. You will need to disable this " | 293 | "from working. You will need to disable this " |
| @@ -498,7 +500,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d): | |||
| 498 | 500 | ||
| 499 | if 'noexec' in (d.getVarFlags('do_unpack', False) or []): | 501 | if 'noexec' in (d.getVarFlags('do_unpack', False) or []): |
| 500 | raise DevtoolError("The %s recipe has do_unpack disabled, unable to " | 502 | raise DevtoolError("The %s recipe has do_unpack disabled, unable to " |
| 501 | "extract source" % pn) | 503 | "extract source" % pn, 4) |
| 502 | 504 | ||
| 503 | if not sync: | 505 | if not sync: |
| 504 | # Prepare for shutil.move later on | 506 | # Prepare for shutil.move later on |
