diff options
| author | Joshua Lock <joshua.g.lock@intel.com> | 2016-12-14 21:13:04 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-16 10:23:23 +0000 |
| commit | c4e2c59088765d1f1de7ec57cde91980f887c2ff (patch) | |
| tree | a2fda8ac5916fb59a711e9220c2177008cca9347 /meta/lib/oe/recipeutils.py | |
| parent | d5e67725ac11e3296cad104470931ffa16824b90 (diff) | |
| download | poky-c4e2c59088765d1f1de7ec57cde91980f887c2ff.tar.gz | |
meta: 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\)
(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/recipeutils.py')
| -rw-r--r-- | meta/lib/oe/recipeutils.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 26c926f214..a7fdd36e40 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
| @@ -328,16 +328,16 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True): | |||
| 328 | 328 | ||
| 329 | # FIXME need a warning if the unexpanded SRC_URI value contains variable references | 329 | # FIXME need a warning if the unexpanded SRC_URI value contains variable references |
| 330 | 330 | ||
| 331 | uris = (d.getVar('SRC_URI', True) or "").split() | 331 | uris = (d.getVar('SRC_URI') or "").split() |
| 332 | fetch = bb.fetch2.Fetch(uris, d) | 332 | fetch = bb.fetch2.Fetch(uris, d) |
| 333 | if download: | 333 | if download: |
| 334 | fetch.download() | 334 | fetch.download() |
| 335 | 335 | ||
| 336 | # Copy local files to target directory and gather any remote files | 336 | # Copy local files to target directory and gather any remote files |
| 337 | bb_dir = os.path.dirname(d.getVar('FILE', True)) + os.sep | 337 | bb_dir = os.path.dirname(d.getVar('FILE')) + os.sep |
| 338 | remotes = [] | 338 | remotes = [] |
| 339 | copied = [] | 339 | copied = [] |
| 340 | includes = [path for path in d.getVar('BBINCLUDED', True).split() if | 340 | includes = [path for path in d.getVar('BBINCLUDED').split() if |
| 341 | path.startswith(bb_dir) and os.path.exists(path)] | 341 | path.startswith(bb_dir) and os.path.exists(path)] |
| 342 | for path in fetch.localpaths() + includes: | 342 | for path in fetch.localpaths() + includes: |
| 343 | # Only import files that are under the meta directory | 343 | # Only import files that are under the meta directory |
| @@ -361,7 +361,7 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True): | |||
| 361 | def get_recipe_local_files(d, patches=False, archives=False): | 361 | def get_recipe_local_files(d, patches=False, archives=False): |
| 362 | """Get a list of local files in SRC_URI within a recipe.""" | 362 | """Get a list of local files in SRC_URI within a recipe.""" |
| 363 | import oe.patch | 363 | import oe.patch |
| 364 | uris = (d.getVar('SRC_URI', True) or "").split() | 364 | uris = (d.getVar('SRC_URI') or "").split() |
| 365 | fetch = bb.fetch2.Fetch(uris, d) | 365 | fetch = bb.fetch2.Fetch(uris, d) |
| 366 | # FIXME this list should be factored out somewhere else (such as the | 366 | # FIXME this list should be factored out somewhere else (such as the |
| 367 | # fetcher) though note that this only encompasses actual container formats | 367 | # fetcher) though note that this only encompasses actual container formats |
| @@ -421,7 +421,7 @@ def get_recipe_patched_files(d): | |||
| 421 | for patch in patches: | 421 | for patch in patches: |
| 422 | _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch) | 422 | _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch) |
| 423 | striplevel = int(parm['striplevel']) | 423 | striplevel = int(parm['striplevel']) |
| 424 | patchedfiles[patchfile] = oe.patch.PatchSet.getPatchedFiles(patchfile, striplevel, os.path.join(d.getVar('S', True), parm.get('patchdir', ''))) | 424 | patchedfiles[patchfile] = oe.patch.PatchSet.getPatchedFiles(patchfile, striplevel, os.path.join(d.getVar('S'), parm.get('patchdir', ''))) |
| 425 | return patchedfiles | 425 | return patchedfiles |
| 426 | 426 | ||
| 427 | 427 | ||
| @@ -459,9 +459,9 @@ def get_bbfile_path(d, destdir, extrapathhint=None): | |||
| 459 | confdata.setVar('LAYERDIR', destlayerdir) | 459 | confdata.setVar('LAYERDIR', destlayerdir) |
| 460 | destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf") | 460 | destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf") |
| 461 | confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata) | 461 | confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata) |
| 462 | pn = d.getVar('PN', True) | 462 | pn = d.getVar('PN') |
| 463 | 463 | ||
| 464 | bbfilespecs = (confdata.getVar('BBFILES', True) or '').split() | 464 | bbfilespecs = (confdata.getVar('BBFILES') or '').split() |
| 465 | if destdir == destlayerdir: | 465 | if destdir == destlayerdir: |
| 466 | for bbfilespec in bbfilespecs: | 466 | for bbfilespec in bbfilespecs: |
| 467 | if not bbfilespec.endswith('.bbappend'): | 467 | if not bbfilespec.endswith('.bbappend'): |
| @@ -474,8 +474,8 @@ def get_bbfile_path(d, destdir, extrapathhint=None): | |||
| 474 | 474 | ||
| 475 | # Try to make up a path that matches BBFILES | 475 | # Try to make up a path that matches BBFILES |
| 476 | # this is a little crude, but better than nothing | 476 | # this is a little crude, but better than nothing |
| 477 | bpn = d.getVar('BPN', True) | 477 | bpn = d.getVar('BPN') |
| 478 | recipefn = os.path.basename(d.getVar('FILE', True)) | 478 | recipefn = os.path.basename(d.getVar('FILE')) |
| 479 | pathoptions = [destdir] | 479 | pathoptions = [destdir] |
| 480 | if extrapathhint: | 480 | if extrapathhint: |
| 481 | pathoptions.append(os.path.join(destdir, extrapathhint)) | 481 | pathoptions.append(os.path.join(destdir, extrapathhint)) |
| @@ -499,7 +499,7 @@ def get_bbappend_path(d, destlayerdir, wildcardver=False): | |||
| 499 | import bb.cookerdata | 499 | import bb.cookerdata |
| 500 | 500 | ||
| 501 | destlayerdir = os.path.abspath(destlayerdir) | 501 | destlayerdir = os.path.abspath(destlayerdir) |
| 502 | recipefile = d.getVar('FILE', True) | 502 | recipefile = d.getVar('FILE') |
| 503 | recipefn = os.path.splitext(os.path.basename(recipefile))[0] | 503 | recipefn = os.path.splitext(os.path.basename(recipefile))[0] |
| 504 | if wildcardver and '_' in recipefn: | 504 | if wildcardver and '_' in recipefn: |
| 505 | recipefn = recipefn.split('_', 1)[0] + '_%' | 505 | recipefn = recipefn.split('_', 1)[0] + '_%' |
| @@ -519,7 +519,7 @@ def get_bbappend_path(d, destlayerdir, wildcardver=False): | |||
| 519 | appendpath = os.path.join(destlayerdir, os.path.relpath(os.path.dirname(recipefile), origlayerdir), appendfn) | 519 | appendpath = os.path.join(destlayerdir, os.path.relpath(os.path.dirname(recipefile), origlayerdir), appendfn) |
| 520 | closepath = '' | 520 | closepath = '' |
| 521 | pathok = True | 521 | pathok = True |
| 522 | for bbfilespec in confdata.getVar('BBFILES', True).split(): | 522 | for bbfilespec in confdata.getVar('BBFILES').split(): |
| 523 | if fnmatch.fnmatchcase(appendpath, bbfilespec): | 523 | if fnmatch.fnmatchcase(appendpath, bbfilespec): |
| 524 | # Our append path works, we're done | 524 | # Our append path works, we're done |
| 525 | break | 525 | break |
| @@ -592,7 +592,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
| 592 | 592 | ||
| 593 | # FIXME check if the bbappend doesn't get overridden by a higher priority layer? | 593 | # FIXME check if the bbappend doesn't get overridden by a higher priority layer? |
| 594 | 594 | ||
| 595 | layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()] | 595 | layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()] |
| 596 | if not os.path.abspath(destlayerdir) in layerdirs: | 596 | if not os.path.abspath(destlayerdir) in layerdirs: |
| 597 | bb.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active') | 597 | bb.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active') |
| 598 | 598 | ||
| @@ -628,7 +628,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
| 628 | else: | 628 | else: |
| 629 | bbappendlines.append((varname, op, value)) | 629 | bbappendlines.append((varname, op, value)) |
| 630 | 630 | ||
| 631 | destsubdir = rd.getVar('PN', True) | 631 | destsubdir = rd.getVar('PN') |
| 632 | if srcfiles: | 632 | if srcfiles: |
| 633 | bbappendlines.append(('FILESEXTRAPATHS_prepend', ':=', '${THISDIR}/${PN}:')) | 633 | bbappendlines.append(('FILESEXTRAPATHS_prepend', ':=', '${THISDIR}/${PN}:')) |
| 634 | 634 | ||
| @@ -647,7 +647,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
| 647 | srcurientry = 'file://%s' % srcfile | 647 | srcurientry = 'file://%s' % srcfile |
| 648 | # Double-check it's not there already | 648 | # Double-check it's not there already |
| 649 | # FIXME do we care if the entry is added by another bbappend that might go away? | 649 | # FIXME do we care if the entry is added by another bbappend that might go away? |
| 650 | if not srcurientry in rd.getVar('SRC_URI', True).split(): | 650 | if not srcurientry in rd.getVar('SRC_URI').split(): |
| 651 | if machine: | 651 | if machine: |
| 652 | appendline('SRC_URI_append%s' % appendoverride, '=', ' ' + srcurientry) | 652 | appendline('SRC_URI_append%s' % appendoverride, '=', ' ' + srcurientry) |
| 653 | else: | 653 | else: |
| @@ -796,7 +796,7 @@ def replace_dir_vars(path, d): | |||
| 796 | # Sort by length so we get the variables we're interested in first | 796 | # Sort by length so we get the variables we're interested in first |
| 797 | for var in sorted(list(d.keys()), key=len): | 797 | for var in sorted(list(d.keys()), key=len): |
| 798 | if var.endswith('dir') and var.lower() == var: | 798 | if var.endswith('dir') and var.lower() == var: |
| 799 | value = d.getVar(var, True) | 799 | value = d.getVar(var) |
| 800 | if value.startswith('/') and not '\n' in value and value not in dirvars: | 800 | if value.startswith('/') and not '\n' in value and value not in dirvars: |
| 801 | dirvars[value] = var | 801 | dirvars[value] = var |
| 802 | for dirpath in sorted(list(dirvars.keys()), reverse=True): | 802 | for dirpath in sorted(list(dirvars.keys()), reverse=True): |
| @@ -850,12 +850,12 @@ def get_recipe_upstream_version(rd): | |||
| 850 | ru['type'] = 'U' | 850 | ru['type'] = 'U' |
| 851 | ru['datetime'] = '' | 851 | ru['datetime'] = '' |
| 852 | 852 | ||
| 853 | pv = rd.getVar('PV', True) | 853 | pv = rd.getVar('PV') |
| 854 | 854 | ||
| 855 | # XXX: If don't have SRC_URI means that don't have upstream sources so | 855 | # XXX: If don't have SRC_URI means that don't have upstream sources so |
| 856 | # returns the current recipe version, so that upstream version check | 856 | # returns the current recipe version, so that upstream version check |
| 857 | # declares a match. | 857 | # declares a match. |
| 858 | src_uris = rd.getVar('SRC_URI', True) | 858 | src_uris = rd.getVar('SRC_URI') |
| 859 | if not src_uris: | 859 | if not src_uris: |
| 860 | ru['version'] = pv | 860 | ru['version'] = pv |
| 861 | ru['type'] = 'M' | 861 | ru['type'] = 'M' |
| @@ -866,13 +866,13 @@ def get_recipe_upstream_version(rd): | |||
| 866 | src_uri = src_uris.split()[0] | 866 | src_uri = src_uris.split()[0] |
| 867 | uri_type, _, _, _, _, _ = decodeurl(src_uri) | 867 | uri_type, _, _, _, _, _ = decodeurl(src_uri) |
| 868 | 868 | ||
| 869 | manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION", True) | 869 | manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION") |
| 870 | if manual_upstream_version: | 870 | if manual_upstream_version: |
| 871 | # manual tracking of upstream version. | 871 | # manual tracking of upstream version. |
| 872 | ru['version'] = manual_upstream_version | 872 | ru['version'] = manual_upstream_version |
| 873 | ru['type'] = 'M' | 873 | ru['type'] = 'M' |
| 874 | 874 | ||
| 875 | manual_upstream_date = rd.getVar("CHECK_DATE", True) | 875 | manual_upstream_date = rd.getVar("CHECK_DATE") |
| 876 | if manual_upstream_date: | 876 | if manual_upstream_date: |
| 877 | date = datetime.strptime(manual_upstream_date, "%b %d, %Y") | 877 | date = datetime.strptime(manual_upstream_date, "%b %d, %Y") |
| 878 | else: | 878 | else: |
