diff options
Diffstat (limited to 'meta/lib/oe/utils.py')
-rw-r--r-- | meta/lib/oe/utils.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 14a7d07ef0..a11db5f3cd 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
@@ -9,6 +9,8 @@ import multiprocessing | |||
9 | import traceback | 9 | import traceback |
10 | import errno | 10 | import errno |
11 | 11 | ||
12 | import bb.parse | ||
13 | |||
12 | def read_file(filename): | 14 | def read_file(filename): |
13 | try: | 15 | try: |
14 | f = open( filename, "r" ) | 16 | f = open( filename, "r" ) |
@@ -265,6 +267,7 @@ def execute_pre_post_process(d, cmds): | |||
265 | bb.note("Executing %s ..." % cmd) | 267 | bb.note("Executing %s ..." % cmd) |
266 | bb.build.exec_func(cmd, d) | 268 | bb.build.exec_func(cmd, d) |
267 | 269 | ||
270 | @bb.parse.vardepsexclude("BB_NUMBER_THREADS") | ||
268 | def get_bb_number_threads(d): | 271 | def get_bb_number_threads(d): |
269 | return int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1) | 272 | return int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1) |
270 | 273 | ||
@@ -316,7 +319,9 @@ def multiprocess_launch_mp(target, items, max_process, extraargs=None): | |||
316 | items = list(items) | 319 | items = list(items) |
317 | while (items and not errors) or launched: | 320 | while (items and not errors) or launched: |
318 | if not errors and items and len(launched) < max_process: | 321 | if not errors and items and len(launched) < max_process: |
319 | args = (items.pop(),) | 322 | args = items.pop() |
323 | if not type(args) is tuple: | ||
324 | args = (args,) | ||
320 | if extraargs is not None: | 325 | if extraargs is not None: |
321 | args = args + extraargs | 326 | args = args + extraargs |
322 | p = ProcessLaunch(target=target, args=args) | 327 | p = ProcessLaunch(target=target, args=args) |
@@ -465,7 +470,7 @@ def host_gcc_version(d, taskcontextonly=False): | |||
465 | version = match.group(1) | 470 | version = match.group(1) |
466 | return "-%s" % version if version in ("4.8", "4.9") else "" | 471 | return "-%s" % version if version in ("4.8", "4.9") else "" |
467 | 472 | ||
468 | 473 | @bb.parse.vardepsexclude("DEFAULTTUNE_MULTILIB_ORIGINAL", "OVERRIDES") | |
469 | def get_multilib_datastore(variant, d): | 474 | def get_multilib_datastore(variant, d): |
470 | localdata = bb.data.createCopy(d) | 475 | localdata = bb.data.createCopy(d) |
471 | if variant: | 476 | if variant: |
@@ -482,19 +487,6 @@ def get_multilib_datastore(variant, d): | |||
482 | localdata.setVar("MLPREFIX", "") | 487 | localdata.setVar("MLPREFIX", "") |
483 | return localdata | 488 | return localdata |
484 | 489 | ||
485 | class ImageQAFailed(Exception): | ||
486 | def __init__(self, description, name=None, logfile=None): | ||
487 | self.description = description | ||
488 | self.name = name | ||
489 | self.logfile=logfile | ||
490 | |||
491 | def __str__(self): | ||
492 | msg = 'Function failed: %s' % self.name | ||
493 | if self.description: | ||
494 | msg = msg + ' (%s)' % self.description | ||
495 | |||
496 | return msg | ||
497 | |||
498 | def sh_quote(string): | 490 | def sh_quote(string): |
499 | import shlex | 491 | import shlex |
500 | return shlex.quote(string) | 492 | return shlex.quote(string) |