summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-07-11 11:07:56 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-12 23:10:15 +0100
commit5c91537ab250e823b362bf5cc94760d26c6a4429 (patch)
tree3e992f843c3a739068b1e5d305356b708bc122bc /scripts/lib/devtool/standard.py
parentd56caf3408d6200d51dff62eae51ffb137ae7393 (diff)
downloadpoky-5c91537ab250e823b362bf5cc94760d26c6a4429.tar.gz
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. (From OE-Core rev: ffd295fed4ab81fc0bd00bb145ef4d72c49584bf) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py16
1 files changed, 9 insertions, 7 deletions
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