]> code.ossystems Code Review - openembedded-core.git/commitdiff
meta: Manual override fixes
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 28 Jul 2021 13:27:33 +0000 (14:27 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Jul 2021 13:25:58 +0000 (14:25 +0100)
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 <richard.purdie@linuxfoundation.org>
21 files changed:
meta/classes/insane.bbclass
meta/classes/kernel-grub.bbclass
meta/classes/native.bbclass
meta/classes/package.bbclass
meta/classes/populate_sdk_ext.bbclass
meta/classes/qemuboot.bbclass
meta/classes/sanity.bbclass
meta/classes/systemd.bbclass
meta/classes/useradd.bbclass
meta/lib/oe/classextend.py
meta/lib/oe/recipeutils.py
meta/lib/oe/sstatesig.py
meta/lib/oeqa/selftest/cases/efibootpartition.py
meta/lib/oeqa/selftest/cases/incompatible_lic.py
meta/lib/oeqa/selftest/cases/recipetool.py
meta/lib/oeqa/selftest/cases/wic.py
meta/recipes-core/volatile-binds/volatile-binds.bb
meta/recipes-devtools/gdb/gdb.inc
meta/recipes-graphics/mesa/mesa.inc
scripts/devtool
scripts/lib/devtool/standard.py

index f9a35f2daacafab0805d2cfb6a9a1ff9a8275cb6..ee858f84b7d27e58853ba2eecef1930e592d88c3 100644 (file)
@@ -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"
index 0bf8fda3e1795a88b8c57bdadee28c3177748e30..44b2015468a03001ac44eb042e030e0b04cfd715 100644 (file)
@@ -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)
 }
 
index 61becfb6d5e156d348892c1f615323cee82c266b..76a599bc155e47d44b10a48af622f7601eca76f3 100644 (file)
@@ -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
index fb8e9514be07084f7c1dd562702f82a12767763a..a659a1ef5ccf94ca4f567340cead88ca28ebf4d1 100644 (file)
@@ -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):
index f67849708cd8a5ebe858eeebcd235bbc9e742f28..10f3265e91b7dd9460daa328e2d90b7486c9ca9b 100644 (file)
@@ -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')
index aaf821d6ddc65baff09c46289706236e5c131459..bf529e9aa4bf5970b978c83fc523e0fe08c8ad5a 100644 (file)
@@ -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':
index 29cc42efe77c849802e7a8461d568ed298fc2635..ddba1e6e1ed433d6c6b42e2130bf80a5917f6629 100644 (file)
@@ -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.
index 2a272a245fda0619d0e4200d112b59606a94507e..09ec52792d5874bc8d0591e035937e4e1a269786 100644 (file)
@@ -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
index fdec5cca560be4dbf20baf21e1bae63bf1433590..287ef843340871d15f7795cb7a87909d96febef0 100644 (file)
@@ -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 ""
index d3d8fbe7244e7e10e299defa66e102d28c1c4828..e08d788b755f0762f50e7c5c98cdf2fba3572089 100644 (file)
@@ -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):
index a66bb92823b301d13b1ba0a8a4df1ec6a9d49ff8..a0c6974f04a3547fb5180d8a7c01ab30a000b33f 100644 (file)
@@ -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('()'):
index f460c50c105effd3a8f3542b93a8ed2354ba25b5..78cdf878f18339c2ff94d77cbfd50132cd3fc129 100644 (file)
@@ -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):
index 3203a7b71d055563ff44135dd820c1adc7259327..26de3a07c9e55ff3693011cc80a25b0ab6f19308 100644 (file)
@@ -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"
index 93be434650a13f9a6ab265827c5d29f4d69a9fac..aa8e0857545b838a9a3ae9b7d94b8c475f9260af 100644 (file)
@@ -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')
 
index 3b99417e841484214c0fb9a0302b3810d3890204..6f531dfa36480ed4b3aef599f5854fc07891a8ea 100644 (file)
@@ -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']
index 32044e74d09546b7181142253d2cfdcf3ca98647..2efbe514c1bc8d7ddaed99945e1b1a65b0894c00 100644 (file)
@@ -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)
index 5eeb65133013b4cf57fb9d0804ff82c1d271d6fa..b693c24c4ca484283a552f2785ed404e7785323b 100644 (file)
@@ -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
 
index f4cd0a5c01b3e788189d1d5080d05d7330c5e2c0..2b0ae1655f6e5150ef14769a6d9bf4478e94da22 100644 (file)
@@ -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
index c636313229f85d019a137f672537caacf9eab606..4f446daaa6e91c31533de0822040aed847b8ec4c 100644 (file)
@@ -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)
index 8a4f41bc372ecebcf4e38d96e28f6441dd6df144..af4811b9221b8ebc84c0a0b0dfc7d8ed6906d773 100755 (executable)
@@ -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 = {}
index 61f40da90f5feb70f248bf7a220fa525df11d629..b74a60d001173557e0a1b8f1f1346bbc95a931a2 100644 (file)
@@ -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'