diff options
| author | Joshua Lock <joshua.g.lock@intel.com> | 2016-11-25 15:28:08 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-30 15:48:09 +0000 |
| commit | 1fce7ecbbb004a5ad82da3eef79cfd52b276708d (patch) | |
| tree | dc19c8ecb8e0b04ba5eafd27a7679bb55585a868 /bitbake/lib/bb/build.py | |
| parent | 1d0c124cdf0282b8d139063409e40982f0ec9888 (diff) | |
| download | poky-1fce7ecbbb004a5ad82da3eef79cfd52b276708d.tar.gz | |
bitbake: bitbake: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.
Search made with the following regex: getVar ?\(( ?[^,()]*), True\)
(Bitbake rev: 3b45c479de8640f92dd1d9f147b02e1eecfaadc8)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
| -rw-r--r-- | bitbake/lib/bb/build.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index e807a0948c..bdd83cd955 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
| @@ -91,13 +91,13 @@ class TaskBase(event.Event): | |||
| 91 | 91 | ||
| 92 | def __init__(self, t, logfile, d): | 92 | def __init__(self, t, logfile, d): |
| 93 | self._task = t | 93 | self._task = t |
| 94 | self._package = d.getVar("PF", True) | 94 | self._package = d.getVar("PF") |
| 95 | self.taskfile = d.getVar("FILE", True) | 95 | self.taskfile = d.getVar("FILE") |
| 96 | self.taskname = self._task | 96 | self.taskname = self._task |
| 97 | self.logfile = logfile | 97 | self.logfile = logfile |
| 98 | self.time = time.time() | 98 | self.time = time.time() |
| 99 | event.Event.__init__(self) | 99 | event.Event.__init__(self) |
| 100 | self._message = "recipe %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName()) | 100 | self._message = "recipe %s: task %s: %s" % (d.getVar("PF"), t, self.getDisplayName()) |
| 101 | 101 | ||
| 102 | def getTask(self): | 102 | def getTask(self): |
| 103 | return self._task | 103 | return self._task |
| @@ -226,17 +226,17 @@ def exec_func(func, d, dirs = None, pythonexception=False): | |||
| 226 | else: | 226 | else: |
| 227 | lockfiles = None | 227 | lockfiles = None |
| 228 | 228 | ||
| 229 | tempdir = d.getVar('T', True) | 229 | tempdir = d.getVar('T') |
| 230 | 230 | ||
| 231 | # or func allows items to be executed outside of the normal | 231 | # or func allows items to be executed outside of the normal |
| 232 | # task set, such as buildhistory | 232 | # task set, such as buildhistory |
| 233 | task = d.getVar('BB_RUNTASK', True) or func | 233 | task = d.getVar('BB_RUNTASK') or func |
| 234 | if task == func: | 234 | if task == func: |
| 235 | taskfunc = task | 235 | taskfunc = task |
| 236 | else: | 236 | else: |
| 237 | taskfunc = "%s.%s" % (task, func) | 237 | taskfunc = "%s.%s" % (task, func) |
| 238 | 238 | ||
| 239 | runfmt = d.getVar('BB_RUNFMT', True) or "run.{func}.{pid}" | 239 | runfmt = d.getVar('BB_RUNFMT') or "run.{func}.{pid}" |
| 240 | runfn = runfmt.format(taskfunc=taskfunc, task=task, func=func, pid=os.getpid()) | 240 | runfn = runfmt.format(taskfunc=taskfunc, task=task, func=func, pid=os.getpid()) |
| 241 | runfile = os.path.join(tempdir, runfn) | 241 | runfile = os.path.join(tempdir, runfn) |
| 242 | bb.utils.mkdirhier(os.path.dirname(runfile)) | 242 | bb.utils.mkdirhier(os.path.dirname(runfile)) |
| @@ -368,7 +368,7 @@ exit $ret | |||
| 368 | 368 | ||
| 369 | cmd = runfile | 369 | cmd = runfile |
| 370 | if d.getVarFlag(func, 'fakeroot', False): | 370 | if d.getVarFlag(func, 'fakeroot', False): |
| 371 | fakerootcmd = d.getVar('FAKEROOT', True) | 371 | fakerootcmd = d.getVar('FAKEROOT') |
| 372 | if fakerootcmd: | 372 | if fakerootcmd: |
| 373 | cmd = [fakerootcmd, runfile] | 373 | cmd = [fakerootcmd, runfile] |
| 374 | 374 | ||
| @@ -429,7 +429,7 @@ exit $ret | |||
| 429 | else: | 429 | else: |
| 430 | break | 430 | break |
| 431 | 431 | ||
| 432 | tempdir = d.getVar('T', True) | 432 | tempdir = d.getVar('T') |
| 433 | fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid()) | 433 | fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid()) |
| 434 | if os.path.exists(fifopath): | 434 | if os.path.exists(fifopath): |
| 435 | os.unlink(fifopath) | 435 | os.unlink(fifopath) |
| @@ -442,7 +442,7 @@ exit $ret | |||
| 442 | with open(os.devnull, 'r+') as stdin: | 442 | with open(os.devnull, 'r+') as stdin: |
| 443 | bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)]) | 443 | bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)]) |
| 444 | except bb.process.CmdError: | 444 | except bb.process.CmdError: |
| 445 | logfn = d.getVar('BB_LOGFILE', True) | 445 | logfn = d.getVar('BB_LOGFILE') |
| 446 | raise FuncFailed(func, logfn) | 446 | raise FuncFailed(func, logfn) |
| 447 | finally: | 447 | finally: |
| 448 | os.unlink(fifopath) | 448 | os.unlink(fifopath) |
| @@ -473,18 +473,18 @@ def _exec_task(fn, task, d, quieterr): | |||
| 473 | logger.debug(1, "Executing task %s", task) | 473 | logger.debug(1, "Executing task %s", task) |
| 474 | 474 | ||
| 475 | localdata = _task_data(fn, task, d) | 475 | localdata = _task_data(fn, task, d) |
| 476 | tempdir = localdata.getVar('T', True) | 476 | tempdir = localdata.getVar('T') |
| 477 | if not tempdir: | 477 | if not tempdir: |
| 478 | bb.fatal("T variable not set, unable to build") | 478 | bb.fatal("T variable not set, unable to build") |
| 479 | 479 | ||
| 480 | # Change nice level if we're asked to | 480 | # Change nice level if we're asked to |
| 481 | nice = localdata.getVar("BB_TASK_NICE_LEVEL", True) | 481 | nice = localdata.getVar("BB_TASK_NICE_LEVEL") |
| 482 | if nice: | 482 | if nice: |
| 483 | curnice = os.nice(0) | 483 | curnice = os.nice(0) |
| 484 | nice = int(nice) - curnice | 484 | nice = int(nice) - curnice |
| 485 | newnice = os.nice(nice) | 485 | newnice = os.nice(nice) |
| 486 | logger.debug(1, "Renice to %s " % newnice) | 486 | logger.debug(1, "Renice to %s " % newnice) |
| 487 | ionice = localdata.getVar("BB_TASK_IONICE_LEVEL", True) | 487 | ionice = localdata.getVar("BB_TASK_IONICE_LEVEL") |
| 488 | if ionice: | 488 | if ionice: |
| 489 | try: | 489 | try: |
| 490 | cls, prio = ionice.split(".", 1) | 490 | cls, prio = ionice.split(".", 1) |
| @@ -495,7 +495,7 @@ def _exec_task(fn, task, d, quieterr): | |||
| 495 | bb.utils.mkdirhier(tempdir) | 495 | bb.utils.mkdirhier(tempdir) |
| 496 | 496 | ||
| 497 | # Determine the logfile to generate | 497 | # Determine the logfile to generate |
| 498 | logfmt = localdata.getVar('BB_LOGFMT', True) or 'log.{task}.{pid}' | 498 | logfmt = localdata.getVar('BB_LOGFMT') or 'log.{task}.{pid}' |
| 499 | logbase = logfmt.format(task=task, pid=os.getpid()) | 499 | logbase = logfmt.format(task=task, pid=os.getpid()) |
| 500 | 500 | ||
| 501 | # Document the order of the tasks... | 501 | # Document the order of the tasks... |
| @@ -627,7 +627,7 @@ def exec_task(fn, task, d, profile = False): | |||
| 627 | quieterr = True | 627 | quieterr = True |
| 628 | 628 | ||
| 629 | if profile: | 629 | if profile: |
| 630 | profname = "profile-%s.log" % (d.getVar("PN", True) + "-" + task) | 630 | profname = "profile-%s.log" % (d.getVar("PN") + "-" + task) |
| 631 | try: | 631 | try: |
| 632 | import cProfile as profile | 632 | import cProfile as profile |
| 633 | except: | 633 | except: |
| @@ -667,8 +667,8 @@ def stamp_internal(taskname, d, file_name, baseonly=False, noextra=False): | |||
| 667 | stamp = d.stamp[file_name] | 667 | stamp = d.stamp[file_name] |
| 668 | extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or "" | 668 | extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or "" |
| 669 | else: | 669 | else: |
| 670 | stamp = d.getVar('STAMP', True) | 670 | stamp = d.getVar('STAMP') |
| 671 | file_name = d.getVar('BB_FILENAME', True) | 671 | file_name = d.getVar('BB_FILENAME') |
| 672 | extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or "" | 672 | extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or "" |
| 673 | 673 | ||
| 674 | if baseonly: | 674 | if baseonly: |
| @@ -703,8 +703,8 @@ def stamp_cleanmask_internal(taskname, d, file_name): | |||
| 703 | stamp = d.stampclean[file_name] | 703 | stamp = d.stampclean[file_name] |
| 704 | extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or "" | 704 | extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or "" |
| 705 | else: | 705 | else: |
| 706 | stamp = d.getVar('STAMPCLEAN', True) | 706 | stamp = d.getVar('STAMPCLEAN') |
| 707 | file_name = d.getVar('BB_FILENAME', True) | 707 | file_name = d.getVar('BB_FILENAME') |
| 708 | extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or "" | 708 | extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or "" |
| 709 | 709 | ||
| 710 | if not stamp: | 710 | if not stamp: |
| @@ -741,7 +741,7 @@ def make_stamp(task, d, file_name = None): | |||
| 741 | # as it completes | 741 | # as it completes |
| 742 | if not task.endswith("_setscene") and task != "do_setscene" and not file_name: | 742 | if not task.endswith("_setscene") and task != "do_setscene" and not file_name: |
| 743 | stampbase = stamp_internal(task, d, None, True) | 743 | stampbase = stamp_internal(task, d, None, True) |
| 744 | file_name = d.getVar('BB_FILENAME', True) | 744 | file_name = d.getVar('BB_FILENAME') |
| 745 | bb.parse.siggen.dump_sigtask(file_name, task, stampbase, True) | 745 | bb.parse.siggen.dump_sigtask(file_name, task, stampbase, True) |
| 746 | 746 | ||
| 747 | def del_stamp(task, d, file_name = None): | 747 | def del_stamp(task, d, file_name = None): |
| @@ -763,7 +763,7 @@ def write_taint(task, d, file_name = None): | |||
| 763 | if file_name: | 763 | if file_name: |
| 764 | taintfn = d.stamp[file_name] + '.' + task + '.taint' | 764 | taintfn = d.stamp[file_name] + '.' + task + '.taint' |
| 765 | else: | 765 | else: |
| 766 | taintfn = d.getVar('STAMP', True) + '.' + task + '.taint' | 766 | taintfn = d.getVar('STAMP') + '.' + task + '.taint' |
| 767 | bb.utils.mkdirhier(os.path.dirname(taintfn)) | 767 | bb.utils.mkdirhier(os.path.dirname(taintfn)) |
| 768 | # The specific content of the taint file is not really important, | 768 | # The specific content of the taint file is not really important, |
| 769 | # we just need it to be random, so a random UUID is used | 769 | # we just need it to be random, so a random UUID is used |
