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/classes/kernel.bbclass | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'meta/classes/kernel.bbclass') diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index b779a767d3..fa598cff7f 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -22,18 +22,18 @@ INITRAMFS_IMAGE_BUNDLE ?= "" # number and cause kernel to be rebuilt. To avoid this, make # KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on # LINUX_VERSION which is a constant. -KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION', True) or ""}" +KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or ""}" KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}" -KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION', True))}" +KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}" KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" python __anonymous () { import re # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES - type = d.getVar('KERNEL_IMAGETYPE', True) or "" - alttype = d.getVar('KERNEL_ALT_IMAGETYPE', True) or "" - types = d.getVar('KERNEL_IMAGETYPES', True) or "" + type = d.getVar('KERNEL_IMAGETYPE') or "" + alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or "" + types = d.getVar('KERNEL_IMAGETYPES') or "" if type not in types.split(): types = (type + ' ' + types).strip() if alttype not in types.split(): @@ -56,15 +56,15 @@ python __anonymous () { d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1') - imagedest = d.getVar('KERNEL_IMAGEDEST', True) - priority = d.getVar('KERNEL_PRIORITY', True) + imagedest = d.getVar('KERNEL_IMAGEDEST') + priority = d.getVar('KERNEL_PRIORITY') postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n' d.setVar('pkg_postinst_kernel-image-' + typelower, postinst) postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n' d.setVar('pkg_postrm_kernel-image-' + typelower, postrm) - image = d.getVar('INITRAMFS_IMAGE', True) + image = d.getVar('INITRAMFS_IMAGE') if image: d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') @@ -72,7 +72,7 @@ python __anonymous () { # The preferred method is to set INITRAMFS_IMAGE, because # this INITRAMFS_TASK has circular dependency problems # if the initramfs requires kernel modules - image_task = d.getVar('INITRAMFS_TASK', True) + image_task = d.getVar('INITRAMFS_TASK') if image_task: d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}') } @@ -101,15 +101,15 @@ inherit ${KERNEL_CLASSES} do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}" do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}" base_do_unpack_append () { - s = d.getVar("S", True) + s = d.getVar("S") if s[-1] == '/': # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail s=s[:-1] - kernsrc = d.getVar("STAGING_KERNEL_DIR", True) + kernsrc = d.getVar("STAGING_KERNEL_DIR") if s != kernsrc: bb.utils.mkdirhier(kernsrc) bb.utils.remove(kernsrc, recurse=True) - if d.getVar("EXTERNALSRC", True): + if d.getVar("EXTERNALSRC"): # With EXTERNALSRC S will not be wiped so we can symlink to it os.symlink(s, kernsrc) else: @@ -127,9 +127,9 @@ PACKAGES_DYNAMIC += "^kernel-firmware-.*" export OS = "${TARGET_OS}" export CROSS_COMPILE = "${TARGET_PREFIX}" -KERNEL_PRIORITY ?= "${@int(d.getVar('PV', True).split('-')[0].split('+')[0].split('.')[0]) * 10000 + \ - int(d.getVar('PV', True).split('-')[0].split('+')[0].split('.')[1]) * 100 + \ - int(d.getVar('PV', True).split('-')[0].split('+')[0].split('.')[-1])}" +KERNEL_PRIORITY ?= "${@int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[0]) * 10000 + \ + int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[1]) * 100 + \ + int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[-1])}" KERNEL_RELEASE ?= "${KERNEL_VERSION}" @@ -140,7 +140,7 @@ KERNEL_IMAGEDEST = "boot" # # configuration # -export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE", True) or "ttyS0"}" +export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE") or "ttyS0"}" KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}" @@ -430,14 +430,14 @@ sysroot_stage_all () { KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig" python check_oldest_kernel() { - oldest_kernel = d.getVar('OLDEST_KERNEL', True) - kernel_version = d.getVar('KERNEL_VERSION', True) - tclibc = d.getVar('TCLIBC', True) + oldest_kernel = d.getVar('OLDEST_KERNEL') + kernel_version = d.getVar('KERNEL_VERSION') + tclibc = d.getVar('TCLIBC') if tclibc == 'glibc': kernel_version = kernel_version.split('-', 1)[0] if oldest_kernel and kernel_version: if bb.utils.vercmp_string(kernel_version, oldest_kernel) < 0: - bb.warn('%s: OLDEST_KERNEL is "%s" but the version of the kernel you are building is "%s" - therefore %s as built may not be compatible with this kernel. Either set OLDEST_KERNEL to an older version, or build a newer kernel.' % (d.getVar('PN', True), oldest_kernel, kernel_version, tclibc)) + bb.warn('%s: OLDEST_KERNEL is "%s" but the version of the kernel you are building is "%s" - therefore %s as built may not be compatible with this kernel. Either set OLDEST_KERNEL to an older version, or build a newer kernel.' % (d.getVar('PN'), oldest_kernel, kernel_version, tclibc)) } check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION" -- cgit 1.2.3-korg