From 4e9a06b64b43131b731fb59a0305f78a98e27fbd Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 28 Jul 2021 14:27:33 +0100 Subject: meta: Manual override fixes The automated conversion of OE-Core to use the new override sytax isn't perfect. This patches some mis-converted lines and some lines which were missed by the automation. Signed-off-by: Richard Purdie --- meta/classes/insane.bbclass | 2 +- meta/classes/kernel-grub.bbclass | 8 ++++---- meta/classes/native.bbclass | 2 +- meta/classes/package.bbclass | 2 +- meta/classes/populate_sdk_ext.bbclass | 2 +- meta/classes/qemuboot.bbclass | 2 ++ meta/classes/sanity.bbclass | 2 +- meta/classes/systemd.bbclass | 2 +- meta/classes/useradd.bbclass | 2 +- meta/lib/oe/classextend.py | 4 ++-- meta/lib/oe/recipeutils.py | 16 ++++++++-------- meta/lib/oe/sstatesig.py | 2 +- meta/lib/oeqa/selftest/cases/efibootpartition.py | 2 +- meta/lib/oeqa/selftest/cases/incompatible_lic.py | 6 +++--- meta/lib/oeqa/selftest/cases/recipetool.py | 4 ++-- meta/lib/oeqa/selftest/cases/wic.py | 4 ++-- meta/recipes-core/volatile-binds/volatile-binds.bb | 2 +- meta/recipes-devtools/gdb/gdb.inc | 2 +- meta/recipes-graphics/mesa/mesa.inc | 4 ++-- scripts/devtool | 2 +- scripts/lib/devtool/standard.py | 8 ++++---- 21 files changed, 41 insertions(+), 39 deletions(-) diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index f9a35f2daa..ee858f84b7 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -1306,7 +1306,7 @@ python () { # Checking ${FILESEXTRAPATHS} extrapaths = (d.getVar("FILESEXTRAPATHS") or "") if '__default' not in extrapaths.split(":"): - msg = "FILESEXTRAPATHS-variable, must always use _prepend (or _append)\n" + msg = "FILESEXTRAPATHS-variable, must always use :prepend (or :append)\n" msg += "type of assignment, and don't forget the colon.\n" msg += "Please assign it with the format of:\n" msg += " FILESEXTRAPATHS:append := \":${THISDIR}/Your_Files_Path\" or\n" diff --git a/meta/classes/kernel-grub.bbclass b/meta/classes/kernel-grub.bbclass index 0bf8fda3e1..44b2015468 100644 --- a/meta/classes/kernel-grub.bbclass +++ b/meta/classes/kernel-grub.bbclass @@ -97,9 +97,9 @@ python __anonymous () { for type in imagetypes.split(): typelower = type.lower() - preinst:append = preinst.replace('KERNEL_IMAGETYPE', type) - postinst:prepend = postinst.replace('KERNEL_IMAGETYPE', type) - d.setVar('pkg_preinst:kernel-image-' + typelower + '_append', preinst:append) - d.setVar('pkg_postinst:kernel-image-' + typelower + '_prepend', postinst:prepend) + preinst_append = preinst.replace('KERNEL_IMAGETYPE', type) + postinst_prepend = postinst.replace('KERNEL_IMAGETYPE', type) + d.setVar('pkg_preinst:kernel-image-' + typelower + ':append', preinst_append) + d.setVar('pkg_postinst:kernel-image-' + typelower + ':prepend', postinst_prepend) } diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass index 61becfb6d5..76a599bc15 100644 --- a/meta/classes/native.bbclass +++ b/meta/classes/native.bbclass @@ -133,7 +133,7 @@ python native_virtclass_handler () { def map_dependencies(varname, d, suffix = "", selfref=True): if suffix: - varname = varname + "_" + suffix + varname = varname + ":" + suffix deps = d.getVar(varname) if not deps: return diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index fb8e9514be..a659a1ef5c 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -1583,7 +1583,7 @@ fi scriptlet = scriptlet_split[0] + "\nset -e\n" + "\n".join(scriptlet_split[1:]) else: scriptlet = "set -e\n" + "\n".join(scriptlet_split[0:]) - d.setVar('%s_%s' % (scriptlet_name, pkg), scriptlet) + d.setVar('%s:%s' % (scriptlet_name, pkg), scriptlet) def write_if_exists(f, pkg, var): def encode(str): diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass index f67849708c..10f3265e91 100644 --- a/meta/classes/populate_sdk_ext.bbclass +++ b/meta/classes/populate_sdk_ext.bbclass @@ -147,7 +147,7 @@ def create_filtered_tasklist(d, sdkbasepath, tasklistfile, conf_initpath): try: with open(sdkbasepath + '/conf/local.conf', 'a') as f: # Force the use of sstate from the build system - f.write('\nSSTATE_DIR_forcevariable = "%s"\n' % d.getVar('SSTATE_DIR')) + f.write('\nSSTATE_DIR:forcevariable = "%s"\n' % d.getVar('SSTATE_DIR')) f.write('SSTATE_MIRRORS:forcevariable = "file://universal/(.*) file://universal-4.9/\\1 file://universal-4.9/(.*) file://universal-4.8/\\1"\n') # Ensure TMPDIR is the default so that clean_esdk_builddir() can delete it f.write('TMPDIR:forcevariable = "${TOPDIR}/tmp"\n') diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index aaf821d6dd..bf529e9aa4 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass @@ -122,6 +122,8 @@ python do_write_qemuboot_conf() { cf = configparser.ConfigParser() cf.add_section('config_bsp') for k in sorted(qemuboot_vars(d)): + if ":" in k: + continue # qemu-helper-native sysroot is not removed by rm_work and # contains all tools required by runqemu if k == 'STAGING_BINDIR_NATIVE': diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 29cc42efe7..ddba1e6e1e 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass @@ -199,7 +199,7 @@ def check_toolchain_tune_args(data, tune, multilib, errs): def check_toolchain_args_present(data, tune, multilib, tune_errors, which): args_set = (data.getVar("TUNE_%s" % which) or "").split() - args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune)) or "").split() + args_wanted = (data.getVar("TUNEABI_REQUIRED_%s:tune-%s" % (which, tune)) or "").split() args_missing = [] # If no args are listed/required, we are done. diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass index 2a272a245f..09ec52792d 100644 --- a/meta/classes/systemd.bbclass +++ b/meta/classes/systemd.bbclass @@ -70,7 +70,7 @@ python systemd_populate_packages() { return def get_package_var(d, var, pkg): - val = (d.getVar('%s_%s' % (var, pkg)) or "").strip() + val = (d.getVar('%s:%s' % (var, pkg)) or "").strip() if val == "": val = (d.getVar(var) or "").strip() return val diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass index fdec5cca56..287ef84334 100644 --- a/meta/classes/useradd.bbclass +++ b/meta/classes/useradd.bbclass @@ -199,7 +199,7 @@ python __anonymous() { def get_all_cmd_params(d, cmd_type): import string - param_type = cmd_type.upper() + "_PARAM_%s" + param_type = cmd_type.upper() + "_PARAM:%s" params = [] useradd_packages = d.getVar('USERADD_PACKAGES') or "" diff --git a/meta/lib/oe/classextend.py b/meta/lib/oe/classextend.py index d3d8fbe724..e08d788b75 100644 --- a/meta/lib/oe/classextend.py +++ b/meta/lib/oe/classextend.py @@ -87,7 +87,7 @@ class ClassExtender(object): def map_depends_variable(self, varname, suffix = ""): # We need to preserve EXTENDPKGV so it can be expanded correctly later if suffix: - varname = varname + "_" + suffix + varname = varname + ":" + suffix orig = self.d.getVar("EXTENDPKGV", False) self.d.setVar("EXTENDPKGV", "EXTENDPKGV") deps = self.d.getVar(varname) @@ -142,7 +142,7 @@ class ClassExtender(object): if pkg_mapping[0].startswith("${") and pkg_mapping[0].endswith("}"): continue for subs in variables: - self.d.renameVar("%s_%s" % (subs, pkg_mapping[0]), "%s_%s" % (subs, pkg_mapping[1])) + self.d.renameVar("%s:%s" % (subs, pkg_mapping[0]), "%s:%s" % (subs, pkg_mapping[1])) class NativesdkClassExtender(ClassExtender): def map_depends(self, dep): diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index a66bb92823..a0c6974f04 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py @@ -47,7 +47,7 @@ def simplify_history(history, d): continue has_set = True elif event['op'] in ('append', 'prepend', 'postdot', 'predot'): - # Reminder: "append" and "prepend" mean += and =+ respectively, NOT _append / _prepend + # Reminder: "append" and "prepend" mean += and =+ respectively, NOT :append / :prepend if has_set: continue ret_history.insert(0, event) @@ -342,7 +342,7 @@ def patch_recipe(d, fn, varvalues, patch=False, relpath='', redirect_output=None def override_applicable(hevent): op = hevent['op'] if '[' in op: - opoverrides = op.split('[')[1].split(']')[0].split('_') + opoverrides = op.split('[')[1].split(']')[0].split(':') for opoverride in opoverrides: if not opoverride in overrides: return False @@ -368,13 +368,13 @@ def patch_recipe(d, fn, varvalues, patch=False, relpath='', redirect_output=None recipe_set = True if not recipe_set: for event in history: - if event['op'].startswith('_remove'): + if event['op'].startswith(':remove'): continue if not override_applicable(event): continue newvalue = value.replace(event['detail'], '') - if newvalue == value and os.path.abspath(event['file']) == fn and event['op'].startswith('_'): - op = event['op'].replace('[', '_').replace(']', '') + if newvalue == value and os.path.abspath(event['file']) == fn and event['op'].startswith(':'): + op = event['op'].replace('[', ':').replace(']', '') extravals[var + op] = None value = newvalue vals[var] = ('+=', value) @@ -758,7 +758,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, appendoverride = '' if machine: bbappendlines.append(('PACKAGE_ARCH', '=', '${MACHINE_ARCH}')) - appendoverride = '_%s' % machine + appendoverride = ':%s' % machine copyfiles = {} if srcfiles: instfunclines = [] @@ -853,11 +853,11 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, newvalue = splitval if len(newvalue) == 1: # Ensure it's written out as one line - if '_append' in varname: + if ':append' in varname: newvalue = ' ' + newvalue[0] else: newvalue = newvalue[0] - if not newvalue and (op in ['+=', '.='] or '_append' in varname): + if not newvalue and (op in ['+=', '.='] or ':append' in varname): # There's no point appending nothing newvalue = None if varname.endswith('()'): diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index f460c50c10..78cdf878f1 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py @@ -246,7 +246,7 @@ class SignatureGeneratorOEBasicHashMixIn(object): continue f.write(" " + self.lockedpnmap[fn] + ":" + task + ":" + self.get_unihash(tid) + " \\\n") f.write(' "\n') - f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(l))) + f.write('SIGGEN_LOCKEDSIGS_TYPES:%s = "%s"' % (self.machine, " ".join(l))) def dump_siglist(self, sigfile, path_prefix_strip=None): def strip_fn(fn): diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py index 3203a7b71d..26de3a07c9 100644 --- a/meta/lib/oeqa/selftest/cases/efibootpartition.py +++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py @@ -26,7 +26,7 @@ class GenericEFITest(OESelftestTestCase): self.write_config(self, """ EFI_PROVIDER = "%s" -IMAGE_FSTYPES:pn-%s_append = " wic" +IMAGE_FSTYPES:pn-%s:append = " wic" MACHINE = "%s" MACHINE_FEATURES:append = " efi" WKS_FILE = "efi-bootdisk.wks.in" diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/meta/lib/oeqa/selftest/cases/incompatible_lic.py index 93be434650..aa8e085754 100644 --- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py +++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py @@ -98,7 +98,7 @@ INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0 LGPL-3.0" raise AssertionError(result.output) def test_bash_and_license(self): - self.write_config(self.default_config() + '\nLICENSE_append_pn-bash = " & SomeLicense"') + self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " & SomeLicense"') error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash cannot be installed into the image because it has incompatible license(s): GPL-3.0-or-later" result = bitbake('core-image-minimal', ignore_status=True) @@ -106,12 +106,12 @@ INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0 LGPL-3.0" raise AssertionError(result.output) def test_bash_or_license(self): - self.write_config(self.default_config() + '\nLICENSE_append_pn-bash = " | SomeLicense"') + self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " | SomeLicense"') bitbake('core-image-minimal') def test_bash_whitelist(self): - self.write_config(self.default_config() + '\nWHITELIST_GPL-3.0_pn-core-image-minimal = "bash"') + self.write_config(self.default_config() + '\nWHITELIST_GPL-3.0:pn-core-image-minimal = "bash"') bitbake('core-image-minimal') diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 3b99417e84..6f531dfa36 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -183,9 +183,9 @@ class RecipetoolTests(RecipetoolBase): '\n', 'PACKAGE_ARCH = "${MACHINE_ARCH}"\n', '\n', - 'SRC_URI:append_mymachine = " file://testfile"\n', + 'SRC_URI:append:mymachine = " file://testfile"\n', '\n', - 'do_install:append_mymachine() {\n', + 'do_install:append:mymachine() {\n', ' install -d ${D}${datadir}\n', ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', '}\n'] diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 32044e74d0..2efbe514c1 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1035,7 +1035,7 @@ class Wic2(WicTestCase): @only_for_arch(['i586', 'i686', 'x86_64']) def test_biosplusefi_plugin_qemu(self): """Test biosplusefi plugin in qemu""" - config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES_append = " efi"\n' + config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n' self.append_config(config) self.assertEqual(0, bitbake('core-image-minimal').status) self.remove_config(config) @@ -1072,7 +1072,7 @@ class Wic2(WicTestCase): # If an image hasn't been built yet, directory ${STAGING_DATADIR}/syslinux won't exists and _get_bootimg_dir() # will raise with "Couldn't find correct bootimg_dir" # The easiest way to work-around this issue is to make sure we already built an image here, hence the bitbake call - config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES_append = " efi"\n' + config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n' self.append_config(config) self.assertEqual(0, bitbake('core-image-minimal').status) self.remove_config(config) diff --git a/meta/recipes-core/volatile-binds/volatile-binds.bb b/meta/recipes-core/volatile-binds/volatile-binds.bb index 5eeb651330..b693c24c4c 100644 --- a/meta/recipes-core/volatile-binds/volatile-binds.bb +++ b/meta/recipes-core/volatile-binds/volatile-binds.bb @@ -68,7 +68,7 @@ do_install () { install -m 0755 mount-copybind ${D}${base_sbindir}/ install -d ${D}${systemd_unitdir}/system - for service in ${SYSTEMD_SERVICE_${PN}}; do + for service in ${SYSTEMD_SERVICE:${PN}}; do install -m 0644 $service ${D}${systemd_unitdir}/system/ done diff --git a/meta/recipes-devtools/gdb/gdb.inc b/meta/recipes-devtools/gdb/gdb.inc index f4cd0a5c01..2b0ae1655f 100644 --- a/meta/recipes-devtools/gdb/gdb.inc +++ b/meta/recipes-devtools/gdb/gdb.inc @@ -2,7 +2,7 @@ require gdb-common.inc inherit gettext -#LDFLAGS_append = " -s" +#LDFLAGS:append = " -s" #export CFLAGS:append=" -L${STAGING_LIBDIR}" # cross-canadian must not see this diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index c636313229..4f446daaa6 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -231,7 +231,7 @@ python __anonymous() { mlprefix = d.getVar("MLPREFIX") fullp = mlprefix + p[1] + "-mesa" + suffix mlprefix = d.getVar("MLPREFIX") - pkgs = " ".join(mlprefix + x + suffix for x in p[1:]) + pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:]) d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1") d.appendVar("RREPLACES:" + fullp, pkgs) d.appendVar("RPROVIDES:" + fullp, pkgs) @@ -241,7 +241,7 @@ python __anonymous() { # For -dev, the first element is both the Debian and original name fullp = mlprefix + p[1] + "-mesa-dev" + suffix - pkgs = mlprefix + p[1] + "-dev" + suffix + pkgs = " " + mlprefix + p[1] + "-dev" + suffix d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1") d.appendVar("RREPLACES:" + fullp, pkgs) d.appendVar("RPROVIDES:" + fullp, pkgs) diff --git a/scripts/devtool b/scripts/devtool index 8a4f41bc37..af4811b922 100755 --- a/scripts/devtool +++ b/scripts/devtool @@ -100,7 +100,7 @@ def read_workspace(): _enable_workspace_layer(config.workspace_path, config, basepath) logger.debug('Reading workspace in %s' % config.workspace_path) - externalsrc_re = re.compile(r'^EXTERNALSRC(_pn-([^ =]+))? *= *"([^"]*)"$') + externalsrc_re = re.compile(r'^EXTERNALSRC(:pn-([^ =]+))? *= *"([^"]*)"$') for fn in glob.glob(os.path.join(config.workspace_path, 'appends', '*.bbappend')): with open(fn, 'r') as f: pnvalues = {} diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 61f40da90f..b74a60d001 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -523,7 +523,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works history = d.varhistory.variable('SRC_URI') for event in history: if not 'flag' in event: - if event['op'].startswith(('_append[', '_prepend[')): + if event['op'].startswith((':append[', ':prepend[')): extra_overrides.append(event['op'].split('[')[1].split(']')[0]) # We want to remove duplicate overrides. If a recipe had multiple # SRC_URI_override += values it would cause mulitple instances of @@ -955,17 +955,17 @@ def modify(args, config, basepath, workspace): f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout ' 'do_fetch do_unpack do_kernel_configcheck"\n') f.write('\ndo_patch[noexec] = "1"\n') - f.write('\ndo_configure_append() {\n' + f.write('\ndo_configure:append() {\n' ' cp ${B}/.config ${S}/.config.baseline\n' ' ln -sfT ${B}/.config ${S}/.config.new\n' '}\n') - f.write('\ndo_kernel_configme_prepend() {\n' + f.write('\ndo_kernel_configme:prepend() {\n' ' if [ -e ${S}/.config ]; then\n' ' mv ${S}/.config ${S}/.config.old\n' ' fi\n' '}\n') if rd.getVarFlag('do_menuconfig','task'): - f.write('\ndo_configure_append() {\n' + f.write('\ndo_configure:append() {\n' ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' ' cp ${B}/.config ${S}/.config.baseline\n' ' ln -sfT ${B}/.config ${S}/.config.new\n' -- cgit 1.2.3-korg