From 7c552996597faaee2fbee185b250c0ee30ea3b5f Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Wed, 14 Dec 2016 21:13:04 +0000 Subject: 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\) Signed-off-by: Joshua Lock Signed-off-by: Ross Burton --- meta/recipes-devtools/gcc/gcc-common.inc | 32 +++++++++--------- meta/recipes-devtools/gcc/gcc-configure-common.inc | 2 +- meta/recipes-devtools/gcc/gcc-cross.inc | 2 +- meta/recipes-devtools/gcc/gcc-multilib-config.inc | 20 ++++++------ meta/recipes-devtools/gcc/libgcc-common.inc | 38 +++++++++++----------- meta/recipes-devtools/gcc/libgfortran.inc | 2 +- 6 files changed, 48 insertions(+), 48 deletions(-) (limited to 'meta/recipes-devtools/gcc') diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc index f540b4d965..d17ba29d1d 100644 --- a/meta/recipes-devtools/gcc/gcc-common.inc +++ b/meta/recipes-devtools/gcc/gcc-common.inc @@ -10,35 +10,35 @@ inherit autotools gettext texinfo BPN = "gcc" def get_gcc_float_setting(bb, d): - if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm": + if d.getVar('ARMPKGSFX_EABI') == "hf" and d.getVar('TRANSLATED_TARGET_ARCH') == "arm": return "--with-float=hard" - if d.getVar('TARGET_FPU', True) in [ 'soft' ]: + if d.getVar('TARGET_FPU') in [ 'soft' ]: return "--with-float=soft" - if d.getVar('TARGET_FPU', True) in [ 'ppc-efd' ]: + if d.getVar('TARGET_FPU') in [ 'ppc-efd' ]: return "--enable-e500_double" return "" get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}" def get_gcc_mips_plt_setting(bb, d): - if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): + if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): return "--with-mips-plt" return "" def get_gcc_ppc_plt_settings(bb, d): - if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d): + if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d): return "--enable-secureplt" return "" def get_long_double_setting(bb, d): - if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]: + if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC') in [ 'uclibc', 'glibc' ]: return "--with-long-double-128" else: return "--without-long-double-128" return "" def get_gcc_multiarch_setting(bb, d): - target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True) + target_arch = d.getVar('TRANSLATED_TARGET_ARCH') multiarch_options = { "i586": "--enable-targets=all", "i686": "--enable-targets=all", @@ -54,7 +54,7 @@ def get_gcc_multiarch_setting(bb, d): # this is used by the multilib setup of gcc def get_tune_parameters(tune, d): - availtunes = d.getVar('AVAILTUNES', True) + availtunes = d.getVar('AVAILTUNES') if tune not in availtunes.split(): bb.error('The tune: %s is not one of the available tunes: %s' % (tune or None, availtunes)) @@ -65,15 +65,15 @@ def get_tune_parameters(tune, d): retdict = {} retdict['tune'] = tune - retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True) - retdict['features'] = localdata.getVar('TUNE_FEATURES', True) + retdict['ccargs'] = localdata.getVar('TUNE_CCARGS') + retdict['features'] = localdata.getVar('TUNE_FEATURES') # BASELIB is used by the multilib code to change library paths - retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True) - retdict['arch'] = localdata.getVar('TUNE_ARCH', True) - retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True) - retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True) - retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True) - retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True) + retdict['baselib'] = localdata.getVar('BASE_LIB') or localdata.getVar('BASELIB') + retdict['arch'] = localdata.getVar('TUNE_ARCH') + retdict['abiextension'] = localdata.getVar('ABIEXTENSION') + retdict['target_fpu'] = localdata.getVar('TARGET_FPU') + retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH') + retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS') return retdict get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS" diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc index ddebbb8410..00ef89ec57 100644 --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc @@ -23,7 +23,7 @@ GCCMULTILIB ?= "--disable-multilib" GCCTHREADS ?= "posix" EXTRA_OECONF = "\ - ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \ + ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS') != 'no']} \ --with-gnu-ld \ --enable-shared \ --enable-languages=${LANGUAGES} \ diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc index cc465a2796..c4f7084ba0 100644 --- a/meta/recipes-devtools/gcc/gcc-cross.inc +++ b/meta/recipes-devtools/gcc/gcc-cross.inc @@ -5,7 +5,7 @@ EXTRADEPENDS = "" DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}" PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" python () { - if d.getVar("TARGET_OS", True).startswith("linux"): + if d.getVar("TARGET_OS").startswith("linux"): d.setVar("EXTRADEPENDS", "linux-libc-headers") } diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc index a0a2ac09a7..31b8619be3 100644 --- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc +++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc @@ -21,8 +21,8 @@ python gcc_multilib_setup() { import shutil import glob - srcdir = d.getVar('S', True) - builddir = d.getVar('B', True) + srcdir = d.getVar('S') + builddir = d.getVar('B') src_conf_dir = '%s/gcc/config' % srcdir build_conf_dir = '%s/gcc/config' % builddir @@ -43,12 +43,12 @@ python gcc_multilib_setup() { bb.utils.mkdirhier('%s/%s' % (build_conf_dir, parent_dir)) bb.utils.copyfile(fn, '%s/%s' % (build_conf_dir, rel_path)) - pn = d.getVar('PN', True) - multilibs = (d.getVar('MULTILIB_VARIANTS', True) or '').split() + pn = d.getVar('PN') + multilibs = (d.getVar('MULTILIB_VARIANTS') or '').split() if not multilibs and pn != "nativesdk-gcc": return - mlprefix = d.getVar('MLPREFIX', True) + mlprefix = d.getVar('MLPREFIX') if ('%sgcc' % mlprefix) != pn and (not pn.startswith('gcc-cross-canadian')) and pn != "nativesdk-gcc": return @@ -155,10 +155,10 @@ python gcc_multilib_setup() { libdirn32 = 'SYSTEMLIBS_DIR' - target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL', True) if mlprefix - else d.getVar('TARGET_ARCH', True)) + target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix + else d.getVar('TARGET_ARCH')) if pn == "nativesdk-gcc": - header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH", True)] + header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH")] write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32) return @@ -188,7 +188,7 @@ python gcc_multilib_setup() { optsets = [] for ml in ml_list: - tune = d.getVar(ml, True) + tune = d.getVar(ml) if not tune: bb.warn("%s doesn't have a corresponding tune. Skipping..." % ml) continue @@ -212,7 +212,7 @@ python gcc_multilib_setup() { # take out '-' mcpu='s and march='s from parameters opts = [] - whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST", True) or "").split() + whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST") or "").split() for i in d.expand(tune_parameters['ccargs']).split(): if i in whitelist: # Need to strip '-' from option diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc index 8a13f542c1..74e9faa528 100644 --- a/meta/recipes-devtools/gcc/libgcc-common.inc +++ b/meta/recipes-devtools/gcc/libgcc-common.inc @@ -64,18 +64,18 @@ addtask multilib_install after do_install before do_package do_populate_sysroot fakeroot python do_multilib_install() { import re - multilibs = d.getVar('MULTILIB_VARIANTS', True) + multilibs = d.getVar('MULTILIB_VARIANTS') if not multilibs or bb.data.inherits_class('nativesdk', d): return - binv = d.getVar('BINV', True) + binv = d.getVar('BINV') - mlprefix = d.getVar('MLPREFIX', True) - if ('%slibgcc' % mlprefix) != d.getVar('PN', True): + mlprefix = d.getVar('MLPREFIX') + if ('%slibgcc' % mlprefix) != d.getVar('PN'): return if mlprefix: - orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True) + orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL') orig_tune_params = get_tune_parameters(orig_tune, d) orig_tune_baselib = orig_tune_params['baselib'] orig_tune_bitness = orig_tune_baselib.replace('lib', '') @@ -83,10 +83,10 @@ fakeroot python do_multilib_install() { orig_tune_bitness = '32' src = '../../../' + orig_tune_baselib + '/' + \ - d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/' + d.getVar('TARGET_SYS_MULTILIB_ORIGINAL') + '/' + binv + '/' - dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \ - d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness + dest = d.getVar('D') + d.getVar('libdir') + '/' + \ + d.getVar('TARGET_SYS') + '/' + binv + '/' + orig_tune_bitness if os.path.lexists(dest): os.unlink(dest) @@ -95,7 +95,7 @@ fakeroot python do_multilib_install() { for ml in multilibs.split(): - tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True) + tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml) if not tune: bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml) continue @@ -118,11 +118,11 @@ fakeroot python do_multilib_install() { libcextension = '' src = '../../../' + tune_baselib + '/' + \ - tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \ - '-' + d.getVar('TARGET_OS', True) + libcextension + '/' + binv + '/' + tune_arch + d.getVar('TARGET_VENDOR') + 'ml' + ml + \ + '-' + d.getVar('TARGET_OS') + libcextension + '/' + binv + '/' - dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \ - d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness + dest = d.getVar('D') + d.getVar('libdir') + '/' + \ + d.getVar('TARGET_SYS') + '/' + binv + '/' + tune_bitness if os.path.lexists(dest): os.unlink(dest) @@ -131,7 +131,7 @@ fakeroot python do_multilib_install() { def get_original_os(d): vendoros = d.expand('${TARGET_ARCH}${ORIG_TARGET_VENDOR}-${TARGET_OS}') - for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]: + for suffix in [d.getVar('ABIEXTENSION'), d.getVar('LIBCEXTENSION')]: if suffix and vendoros.endswith(suffix): vendoros = vendoros[:-len(suffix)] # Arm must use linux-gnueabi not linux as only the former is accepted by gcc @@ -144,11 +144,11 @@ BASETARGET_SYS = "${@get_original_os(d)}" addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot fakeroot python do_extra_symlinks() { - targetsys = d.getVar('BASETARGET_SYS', True) + targetsys = d.getVar('BASETARGET_SYS') - if targetsys != d.getVar('TARGET_SYS', True): - dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + targetsys - src = d.getVar('TARGET_SYS', True) - if not os.path.lexists(dest) and os.path.lexists(d.getVar('D', True) + d.getVar('libdir', True)): + if targetsys != d.getVar('TARGET_SYS'): + dest = d.getVar('D') + d.getVar('libdir') + '/' + targetsys + src = d.getVar('TARGET_SYS') + if not os.path.lexists(dest) and os.path.lexists(d.getVar('D') + d.getVar('libdir')): os.symlink(src, dest) } diff --git a/meta/recipes-devtools/gcc/libgfortran.inc b/meta/recipes-devtools/gcc/libgfortran.inc index 58ceb2e073..194363543e 100644 --- a/meta/recipes-devtools/gcc/libgfortran.inc +++ b/meta/recipes-devtools/gcc/libgfortran.inc @@ -69,7 +69,7 @@ do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" python __anonymous () { - f = d.getVar("FORTRAN", True) + f = d.getVar("FORTRAN") if "fortran" not in f: raise bb.parse.SkipPackage("libgfortran needs fortran support to be enabled in the compiler") } -- cgit 1.2.3-korg