All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] bitbake: Switch to using new override syntax
@ 2021-07-30 13:47 Richard Purdie
  2021-07-30 13:47 ` [PATCH 2/4] doc/lib: Update to use new override syntax containing colons Richard Purdie
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Richard Purdie @ 2021-07-30 13:47 UTC (permalink / raw)
  To: bitbake-devel

This change updates the datastore to use the new override syntax using
colons instead of underscores exclusively. It is expected layers would
have to be converted to work with bitbake after this change.

Supporting mixed syntax isn't possible, it is only feasible to have
one internal representation of overrides.

Whilst we can't warn for every possible override that may be set in the
old format, show errors for _append/_prepend/_remove since those should
never be present.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/cache.py      |   4 +-
 lib/bb/data_smart.py | 113 +++++++++++++++++++++----------------------
 lib/bb/parse/ast.py  |   2 -
 lib/bb/siggen.py     |   4 +-
 4 files changed, 59 insertions(+), 64 deletions(-)

diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index 27eb271798..73bc6e9665 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -53,12 +53,12 @@ class RecipeInfoCommon(object):
 
     @classmethod
     def pkgvar(cls, var, packages, metadata):
-        return dict((pkg, cls.depvar("%s_%s" % (var, pkg), metadata))
+        return dict((pkg, cls.depvar("%s:%s" % (var, pkg), metadata))
                     for pkg in packages)
 
     @classmethod
     def taskvar(cls, var, tasks, metadata):
-        return dict((task, cls.getvar("%s_task-%s" % (var, task), metadata))
+        return dict((task, cls.getvar("%s:task-%s" % (var, task), metadata))
                     for task in tasks)
 
     @classmethod
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index b4ed62a4e5..43e9e78555 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -26,8 +26,8 @@ from bb.COW  import COWDictBase
 
 logger = logging.getLogger("BitBake.Data")
 
-__setvar_keyword__ = ["_append", "_prepend", "_remove"]
-__setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
+__setvar_keyword__ = [":append", ":prepend", ":remove"]
+__setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>:append|:prepend|:remove)(:(?P<add>[^A-Z]*))?$')
 __expand_var_regexp__ = re.compile(r"\${[a-zA-Z0-9\-_+./~:]+?}")
 __expand_python_regexp__ = re.compile(r"\${@.+?}")
 __whitespace_split__ = re.compile(r'(\s)')
@@ -277,7 +277,7 @@ class VariableHistory(object):
             for (r, override) in d.overridedata[var]:
                 for event in self.variable(r):
                     loginfo = event.copy()
-                    if 'flag' in loginfo and not loginfo['flag'].startswith("_"):
+                    if 'flag' in loginfo and not loginfo['flag'].startswith(("_", ":")):
                         continue
                     loginfo['variable'] = var
                     loginfo['op'] = 'override[%s]:%s' % (override, loginfo['op'])
@@ -342,7 +342,7 @@ class VariableHistory(object):
         for event in history:
             if 'flag' in event:
                 continue
-            if event['op'] == '_remove':
+            if event['op'] == ':remove':
                 continue
             if isset and event['op'] == 'set?':
                 continue
@@ -481,7 +481,15 @@ class DataSmart(MutableMapping):
 
     def setVar(self, var, value, **loginfo):
         #print("var=" + str(var) + "  val=" + str(value))
-        var = var.replace(":", "_")
+
+        if "_append" in var or "_prepend" in var or "_remove" in var:
+            info = "%s" % var
+            if "filename" in loginfo:
+                info += " file: %s" % loginfo[filename]
+            if "lineno" in loginfo:
+                info += " line: %s" % loginfo[lineno]
+            bb.fatal("Variable %s contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake." % info)
+
         self.expand_cache = {}
         parsing=False
         if 'parsing' in loginfo:
@@ -510,7 +518,7 @@ class DataSmart(MutableMapping):
             # pay the cookie monster
 
             # more cookies for the cookie monster
-            if '_' in var:
+            if ':' in var:
                 self._setvar_update_overrides(base, **loginfo)
 
             if base in self.overridevars:
@@ -521,27 +529,27 @@ class DataSmart(MutableMapping):
             self._makeShadowCopy(var)
 
         if not parsing:
-            if "_append" in self.dict[var]:
-                del self.dict[var]["_append"]
-            if "_prepend" in self.dict[var]:
-                del self.dict[var]["_prepend"]
-            if "_remove" in self.dict[var]:
-                del self.dict[var]["_remove"]
+            if ":append" in self.dict[var]:
+                del self.dict[var][":append"]
+            if ":prepend" in self.dict[var]:
+                del self.dict[var][":prepend"]
+            if ":remove" in self.dict[var]:
+                del self.dict[var][":remove"]
             if var in self.overridedata:
                 active = []
                 self.need_overrides()
                 for (r, o) in self.overridedata[var]:
                     if o in self.overridesset:
                         active.append(r)
-                    elif "_" in o:
-                        if set(o.split("_")).issubset(self.overridesset):
+                    elif ":" in o:
+                        if set(o.split(":")).issubset(self.overridesset):
                             active.append(r)
                 for a in active:
                     self.delVar(a)
                 del self.overridedata[var]
 
         # more cookies for the cookie monster
-        if '_' in var:
+        if ':' in var:
             self._setvar_update_overrides(var, **loginfo)
 
         # setting var
@@ -567,8 +575,8 @@ class DataSmart(MutableMapping):
 
     def _setvar_update_overrides(self, var, **loginfo):
         # aka pay the cookie monster
-        override = var[var.rfind('_')+1:]
-        shortvar = var[:var.rfind('_')]
+        override = var[var.rfind(':')+1:]
+        shortvar = var[:var.rfind(':')]
         while override and __override_regexp__.match(override):
             if shortvar not in self.overridedata:
                 self.overridedata[shortvar] = []
@@ -577,9 +585,9 @@ class DataSmart(MutableMapping):
                 self.overridedata[shortvar] = list(self.overridedata[shortvar])
                 self.overridedata[shortvar].append([var, override])
             override = None
-            if "_" in shortvar:
-                override = var[shortvar.rfind('_')+1:]
-                shortvar = var[:shortvar.rfind('_')]
+            if ":" in shortvar:
+                override = var[shortvar.rfind(':')+1:]
+                shortvar = var[:shortvar.rfind(':')]
                 if len(shortvar) == 0:
                     override = None
 
@@ -590,8 +598,6 @@ class DataSmart(MutableMapping):
         """
         Rename the variable key to newkey
         """
-        key = key.replace(":", "_")
-        newkey = newkey.replace(":", "_")
         if key == newkey:
             bb.warn("Calling renameVar with equivalent keys (%s) is invalid" % key)
             return
@@ -620,7 +626,7 @@ class DataSmart(MutableMapping):
                 self.overridedata[newkey].append([v.replace(key, newkey), o])
                 self.renameVar(v, v.replace(key, newkey))
 
-        if '_' in newkey and val is None:
+        if ':' in newkey and val is None:
             self._setvar_update_overrides(newkey, **loginfo)
 
         loginfo['variable'] = key
@@ -632,15 +638,14 @@ class DataSmart(MutableMapping):
     def appendVar(self, var, value, **loginfo):
         loginfo['op'] = 'append'
         self.varhistory.record(**loginfo)
-        self.setVar(var + "_append", value, ignore=True, parsing=True)
+        self.setVar(var + ":append", value, ignore=True, parsing=True)
 
     def prependVar(self, var, value, **loginfo):
         loginfo['op'] = 'prepend'
         self.varhistory.record(**loginfo)
-        self.setVar(var + "_prepend", value, ignore=True, parsing=True)
+        self.setVar(var + ":prepend", value, ignore=True, parsing=True)
 
     def delVar(self, var, **loginfo):
-        var = var.replace(":", "_")
         self.expand_cache = {}
 
         loginfo['detail'] = ""
@@ -649,9 +654,9 @@ class DataSmart(MutableMapping):
         self.dict[var] = {}
         if var in self.overridedata:
             del self.overridedata[var]
-        if '_' in var:
-            override = var[var.rfind('_')+1:]
-            shortvar = var[:var.rfind('_')]
+        if ':' in var:
+            override = var[var.rfind(':')+1:]
+            shortvar = var[:var.rfind(':')]
             while override and override.islower():
                 try:
                     if shortvar in self.overridedata:
@@ -661,14 +666,13 @@ class DataSmart(MutableMapping):
                 except ValueError as e:
                     pass
                 override = None
-                if "_" in shortvar:
-                    override = var[shortvar.rfind('_')+1:]
-                    shortvar = var[:shortvar.rfind('_')]
+                if ":" in shortvar:
+                    override = var[shortvar.rfind(':')+1:]
+                    shortvar = var[:shortvar.rfind(':')]
                     if len(shortvar) == 0:
                          override = None
 
     def setVarFlag(self, var, flag, value, **loginfo):
-        var = var.replace(":", "_")
         self.expand_cache = {}
 
         if 'op' not in loginfo:
@@ -679,7 +683,7 @@ class DataSmart(MutableMapping):
             self._makeShadowCopy(var)
         self.dict[var][flag] = value
 
-        if flag == "_defaultval" and '_' in var:
+        if flag == "_defaultval" and ':' in var:
             self._setvar_update_overrides(var, **loginfo)
         if flag == "_defaultval" and var in self.overridevars:
             self._setvar_update_overridevars(var, value)
@@ -692,7 +696,6 @@ class DataSmart(MutableMapping):
             self.dict["__exportlist"]["_content"].add(var)
 
     def getVarFlag(self, var, flag, expand=True, noweakdefault=False, parsing=False, retparser=False):
-        var = var.replace(":", "_")
         if flag == "_content":
             cachename = var
         else:
@@ -712,11 +715,11 @@ class DataSmart(MutableMapping):
             active = {}
             self.need_overrides()
             for (r, o) in overridedata:
-                # What about double overrides both with "_" in the name?
+                # FIXME What about double overrides both with "_" in the name?
                 if o in self.overridesset:
                     active[o] = r
-                elif "_" in o:
-                    if set(o.split("_")).issubset(self.overridesset):
+                elif ":" in o:
+                    if set(o.split(":")).issubset(self.overridesset):
                         active[o] = r
 
             mod = True
@@ -724,10 +727,10 @@ class DataSmart(MutableMapping):
                 mod = False
                 for o in self.overrides:
                     for a in active.copy():
-                        if a.endswith("_" + o):
+                        if a.endswith(":" + o):
                             t = active[a]
                             del active[a]
-                            active[a.replace("_" + o, "")] = t
+                            active[a.replace(":" + o, "")] = t
                             mod = True
                         elif a == o:
                             match = active[a]
@@ -746,28 +749,28 @@ class DataSmart(MutableMapping):
                 value = copy.copy(local_var["_defaultval"])
 
 
-        if flag == "_content" and local_var is not None and "_append" in local_var and not parsing:
+        if flag == "_content" and local_var is not None and ":append" in local_var and not parsing:
             if not value:
                 value = ""
             self.need_overrides()
-            for (r, o) in local_var["_append"]:
+            for (r, o) in local_var[":append"]:
                 match = True
                 if o:
-                    for o2 in o.split("_"):
+                    for o2 in o.split(":"):
                         if not o2 in self.overrides:
                             match = False                            
                 if match:
                     value = value + r
 
-        if flag == "_content" and local_var is not None and "_prepend" in local_var and not parsing:
+        if flag == "_content" and local_var is not None and ":prepend" in local_var and not parsing:
             if not value:
                 value = ""
             self.need_overrides()
-            for (r, o) in local_var["_prepend"]:
+            for (r, o) in local_var[":prepend"]:
 
                 match = True
                 if o:
-                    for o2 in o.split("_"):
+                    for o2 in o.split(":"):
                         if not o2 in self.overrides:
                             match = False                            
                 if match:
@@ -779,12 +782,12 @@ class DataSmart(MutableMapping):
         if expand:
             value = parser.value
 
-        if value and flag == "_content" and local_var is not None and "_remove" in local_var and not parsing:
+        if value and flag == "_content" and local_var is not None and ":remove" in local_var and not parsing:
             self.need_overrides()
-            for (r, o) in local_var["_remove"]:
+            for (r, o) in local_var[":remove"]:
                 match = True
                 if o:
-                    for o2 in o.split("_"):
+                    for o2 in o.split(":"):
                         if not o2 in self.overrides:
                             match = False                            
                 if match:
@@ -820,7 +823,6 @@ class DataSmart(MutableMapping):
         return value
 
     def delVarFlag(self, var, flag, **loginfo):
-        var = var.replace(":", "_")
         self.expand_cache = {}
 
         local_var, _ = self._findVar(var)
@@ -838,7 +840,6 @@ class DataSmart(MutableMapping):
             del self.dict[var][flag]
 
     def appendVarFlag(self, var, flag, value, **loginfo):
-        var = var.replace(":", "_")
         loginfo['op'] = 'append'
         loginfo['flag'] = flag
         self.varhistory.record(**loginfo)
@@ -846,7 +847,6 @@ class DataSmart(MutableMapping):
         self.setVarFlag(var, flag, newvalue, ignore=True)
 
     def prependVarFlag(self, var, flag, value, **loginfo):
-        var = var.replace(":", "_")
         loginfo['op'] = 'prepend'
         loginfo['flag'] = flag
         self.varhistory.record(**loginfo)
@@ -854,7 +854,6 @@ class DataSmart(MutableMapping):
         self.setVarFlag(var, flag, newvalue, ignore=True)
 
     def setVarFlags(self, var, flags, **loginfo):
-        var = var.replace(":", "_")
         self.expand_cache = {}
         infer_caller_details(loginfo)
         if not var in self.dict:
@@ -869,13 +868,12 @@ class DataSmart(MutableMapping):
             self.dict[var][i] = flags[i]
 
     def getVarFlags(self, var, expand = False, internalflags=False):
-        var = var.replace(":", "_")
         local_var, _ = self._findVar(var)
         flags = {}
 
         if local_var:
             for i in local_var:
-                if i.startswith("_") and not internalflags:
+                if i.startswith(("_", ":")) and not internalflags:
                     continue
                 flags[i] = local_var[i]
                 if expand and i in expand:
@@ -886,7 +884,6 @@ class DataSmart(MutableMapping):
 
 
     def delVarFlags(self, var, **loginfo):
-        var = var.replace(":", "_")
         self.expand_cache = {}
         if not var in self.dict:
             self._makeShadowCopy(var)
@@ -974,8 +971,8 @@ class DataSmart(MutableMapping):
             for (r, o) in self.overridedata[var]:
                 if o in self.overridesset:
                     overrides.add(var)
-                elif "_" in o:
-                    if set(o.split("_")).issubset(self.overridesset):
+                elif ":" in o:
+                    if set(o.split(":")).issubset(self.overridesset):
                         overrides.add(var)
 
         for k in keylist(self.dict):
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 977ba375bf..743ea0dfc0 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -97,7 +97,6 @@ class DataNode(AstNode):
     def eval(self, data):
         groupd = self.groupd
         key = groupd["var"]
-        key = key.replace(":", "_")
         loginfo = {
             'variable': key,
             'file': self.filename,
@@ -208,7 +207,6 @@ class ExportFuncsNode(AstNode):
     def eval(self, data):
 
         for func in self.n:
-            func = func.replace(":", "_")
             calledfunc = self.classname + "_" + func
 
             if data.getVar(func, False) and not data.getVarFlag(func, 'export_func', False):
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 07692e673c..3f9fe50642 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -228,7 +228,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
         #    self.dump_sigtask(fn, task, d.getVar("STAMP"), False)
 
         for task in taskdeps:
-            d.setVar("BB_BASEHASH_task-%s" % task, self.basehash[fn + ":" + task])
+            d.setVar("BB_BASEHASH:task-%s" % task, self.basehash[fn + ":" + task])
 
     def postparsing_clean_cache(self):
         #
@@ -325,7 +325,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
 
         h = hashlib.sha256(data.encode("utf-8")).hexdigest()
         self.taskhash[tid] = h
-        #d.setVar("BB_TASKHASH_task-%s" % task, taskhash[task])
+        #d.setVar("BB_TASKHASH:task-%s" % task, taskhash[task])
         return h
 
     def writeout_file_checksum_cache(self):
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/4] doc/lib: Update to use new override syntax containing colons
  2021-07-30 13:47 [PATCH 1/4] bitbake: Switch to using new override syntax Richard Purdie
@ 2021-07-30 13:47 ` Richard Purdie
  2021-07-30 14:08   ` [bitbake-devel] " Quentin Schulz
  2021-07-30 13:47 ` [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion Richard Purdie
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Richard Purdie @ 2021-07-30 13:47 UTC (permalink / raw)
  To: bitbake-devel

This runs the overrides conversion script in OE-Core over the bitbake code
base including the docs. A handful of things were excluded in toaster
and for the Changelog file.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 contrib/vim/plugin/newbbappend.vim            |  2 +-
 .../bitbake-user-manual-metadata.rst          | 64 +++++++++----------
 .../bitbake-user-manual-ref-variables.rst     | 14 ++--
 lib/bb/fetch2/__init__.py                     |  2 +-
 lib/bb/tests/data.py                          | 52 +++++++--------
 lib/bb/tests/parse.py                         | 16 ++---
 lib/toaster/orm/models.py                     |  2 +-
 lib/toaster/toastergui/views.py               |  6 +-
 .../management/commands/buildimport.py        |  2 +-
 9 files changed, 80 insertions(+), 80 deletions(-)

diff --git a/contrib/vim/plugin/newbbappend.vim b/contrib/vim/plugin/newbbappend.vim
index e04174cf62..3f65f79cdc 100644
--- a/contrib/vim/plugin/newbbappend.vim
+++ b/contrib/vim/plugin/newbbappend.vim
@@ -20,7 +20,7 @@ fun! NewBBAppendTemplate()
     set nopaste
 
     " New bbappend template
-    0 put ='FILESEXTRAPATHS_prepend := \"${THISDIR}/${PN}:\"'
+    0 put ='FILESEXTRAPATHS:prepend := \"${THISDIR}/${PN}:\"'
     2
 
     if paste == 1
diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index 3e14163ebe..db44e26fbd 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -281,11 +281,11 @@ operators in that their effects are applied at variable expansion time
 rather than being immediately applied. Here are some examples::
 
    B = "bval"
-   B_append = " additional data"
+   B:append = " additional data"
    C = "cval"
-   C_prepend = "additional data "
+   C:prepend = "additional data "
    D = "dval"
-   D_append = "additional data"
+   D:append = "additional data"
 
 The variable :term:`B`
 becomes "bval additional data" and ``C`` becomes "additional data cval".
@@ -312,10 +312,10 @@ When you use this syntax, BitBake expects one or more strings.
 Surrounding spaces and spacing are preserved. Here is an example::
 
    FOO = "123 456 789 123456 123 456 123 456"
-   FOO_remove = "123"
-   FOO_remove = "456"
+   FOO:remove = "123"
+   FOO:remove = "456"
    FOO2 = " abc def ghi abcdef abc def abc def def"
-   FOO2_remove = "\
+   FOO2:remove = "\
        def \
        abc \
        ghi \
@@ -349,15 +349,15 @@ If, on the other hand, ``foo.bbclass``
 uses the "_append" operator, then the final value of ``FOO`` will be
 "initial val", as intended::
 
-   FOO_append = " val"
+   FOO:append = " val"
 
 .. note::
 
    It is never necessary to use "+=" together with "_append". The following
    sequence of assignments appends "barbaz" to FOO::
 
-       FOO_append = "bar"
-       FOO_append = "baz"
+       FOO:append = "bar"
+       FOO:append = "baz"
 
 
    The only effect of changing the second assignment in the previous
@@ -538,12 +538,12 @@ variable.
    that value based on the architecture of the build::
 
       KBRANCH = "standard/base"
-      KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
-      KBRANCH_qemumips = "standard/mti-malta32"
-      KBRANCH_qemuppc = "standard/qemuppc"
-      KBRANCH_qemux86 = "standard/common-pc/base"
-      KBRANCH_qemux86-64 = "standard/common-pc-64/base"
-      KBRANCH_qemumips64 = "standard/mti-malta64"
+      KBRANCH:qemuarm = "standard/arm-versatile-926ejs"
+      KBRANCH:qemumips = "standard/mti-malta32"
+      KBRANCH:qemuppc = "standard/qemuppc"
+      KBRANCH:qemux86 = "standard/common-pc/base"
+      KBRANCH:qemux86-64 = "standard/common-pc-64/base"
+      KBRANCH:qemumips64 = "standard/mti-malta64"
 
 -  *Appending and Prepending:* BitBake also supports append and prepend
    operations to variable values based on whether a specific item is
@@ -551,7 +551,7 @@ variable.
 
       DEPENDS = "glibc ncurses"
       OVERRIDES = "machine:local"
-      DEPENDS_append_machine = "libmad"
+      DEPENDS:append_machine = "libmad"
 
    In this example, :term:`DEPENDS` becomes "glibc ncurses libmad".
 
@@ -559,15 +559,15 @@ variable.
    example, the following lines will conditionally append to the
    ``KERNEL_FEATURES`` variable based on the architecture::
 
-      KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
-      KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
-      KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+      KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"
+      KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+      KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
 
 -  *Setting a Variable for a Single Task:* BitBake supports setting a
    variable just for the duration of a single task. Here is an example::
 
       FOO_task-configure = "val 1"
-      FOO_task-compile = "val 2"
+      FOO:task-compile = "val 2"
 
    In the
    previous example, ``FOO`` has the value "val 1" while the
@@ -582,7 +582,7 @@ variable.
    You can also use this syntax with other combinations (e.g.
    "``_prepend``") as shown in the following example::
 
-      EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
+      EXTRA_OEMAKE:prepend:task-compile = "${PARALLEL_MAKE} "
 
 Key Expansion
 -------------
@@ -618,7 +618,7 @@ example::
 
    OVERRIDES = "foo"
    A = "Z"
-   A_foo_append = "X"
+   A_foo:append = "X"
 
 For this case,
 ``A`` is unconditionally set to "Z" and "X" is unconditionally and
@@ -635,7 +635,7 @@ This next example changes the order of the override and the append::
 
    OVERRIDES = "foo"
    A = "Z"
-   A_append_foo = "X"
+   A:append_foo = "X"
 
 For this case, before
 overrides are handled, ``A`` is set to "Z" and ``A_append_foo`` is set
@@ -648,8 +648,8 @@ back as in the first example::
 
    OVERRIDES = "foo"
    A = "Y"
-   A_foo_append = "Z"
-   A_foo_append = "X"
+   A_foo:append = "Z"
+   A_foo:append = "X"
 
 For this case, before any overrides are resolved,
 ``A`` is set to "Y" using an immediate assignment. After this immediate
@@ -661,8 +661,8 @@ leaving the variable set to "ZX". Finally, applying the override for
 This final example mixes in some varying operators::
 
    A = "1"
-   A_append = "2"
-   A_append = "3"
+   A:append = "2"
+   A:append = "3"
    A += "4"
    A .= "5"
 
@@ -919,7 +919,7 @@ As an example, consider the following::
        fn
    }
 
-   fn_prepend() {
+   fn:prepend() {
        bbplain second
    }
 
@@ -927,7 +927,7 @@ As an example, consider the following::
        bbplain third
    }
 
-   do_foo_append() {
+   do_foo:append() {
        bbplain fourth
    }
 
@@ -977,7 +977,7 @@ override-style operators to BitBake-style Python functions.
 
 As an example, consider the following::
 
-   python do_foo_prepend() {
+   python do_foo:prepend() {
        bb.plain("first")
    }
 
@@ -985,7 +985,7 @@ As an example, consider the following::
        bb.plain("second")
    }
 
-   python do_foo_append() {
+   python do_foo:append() {
        bb.plain("third")
    }
 
@@ -1139,7 +1139,7 @@ before anonymous functions run. In the following example, ``FOO`` ends
 up with the value "foo from anonymous"::
 
    FOO = "foo"
-   FOO_append = " from outside"
+   FOO:append = " from outside"
 
    python () {
        d.setVar("FOO", "foo from anonymous")
diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
index 797e2a00cc..6283c2654c 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
@@ -1118,7 +1118,7 @@ overview of their function and contents.
       attempt before any others by adding something like the following to
       your configuration::
 
-         PREMIRRORS_prepend = "\
+         PREMIRRORS:prepend = "\
          git://.*/.* http://www.yoctoproject.org/sources/ \n \
          ftp://.*/.* http://www.yoctoproject.org/sources/ \n \
          http://.*/.* http://www.yoctoproject.org/sources/ \n \
@@ -1184,7 +1184,7 @@ overview of their function and contents.
       that depends on the ``perl`` package. In this case, you would use the
       following :term:`RDEPENDS` statement::
 
-         RDEPENDS_${PN}-dev += "perl"
+         RDEPENDS:${PN}-dev += "perl"
 
       In the example, the development package depends on the ``perl`` package.
       Thus, the :term:`RDEPENDS` variable has the ``${PN}-dev`` package name as part
@@ -1195,7 +1195,7 @@ overview of their function and contents.
       differences from you. Here is the general syntax to specify versions
       with the :term:`RDEPENDS` variable::
 
-         RDEPENDS_${PN} = "package (operator version)"
+         RDEPENDS:${PN} = "package (operator version)"
 
       For ``operator``, you can specify the following::
 
@@ -1208,7 +1208,7 @@ overview of their function and contents.
       For example, the following sets up a dependency on version 1.2 or
       greater of the package ``foo``::
 
-         RDEPENDS_${PN} = "foo (>= 1.2)"
+         RDEPENDS:${PN} = "foo (>= 1.2)"
 
       For information on build-time dependencies, see the :term:`DEPENDS`
       variable.
@@ -1237,7 +1237,7 @@ overview of their function and contents.
       variable in conjunction with a package name override. Here is an
       example::
 
-         RPROVIDES_${PN} = "widget-abi-2"
+         RPROVIDES:${PN} = "widget-abi-2"
 
    :term:`RRECOMMENDS`
       A list of packages that extends the usability of a package being
@@ -1251,7 +1251,7 @@ overview of their function and contents.
       differences from you. Here is the general syntax to specify versions
       with the :term:`RRECOMMENDS` variable::
 
-         RRECOMMENDS_${PN} = "package (operator version)"
+         RRECOMMENDS:${PN} = "package (operator version)"
 
       For ``operator``, you can specify the following::
 
@@ -1264,7 +1264,7 @@ overview of their function and contents.
       For example, the following sets up a recommend on version
       1.2 or greater of the package ``foo``::
 
-         RRECOMMENDS_${PN} = "foo (>= 1.2)"
+         RRECOMMENDS:${PN} = "foo (>= 1.2)"
 
    :term:`SECTION`
       The section in which packages should be categorized.
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 0d49e1da37..60aaf3902a 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1150,7 +1150,7 @@ def srcrev_internal_helper(ud, d, name):
     if name != '':
         attempts.append("SRCREV_%s" % name)
     if pn:
-        attempts.append("SRCREV_pn-%s" % pn)
+        attempts.append("SRCREV:pn-%s" % pn)
     attempts.append("SRCREV")
 
     for a in attempts:
diff --git a/lib/bb/tests/data.py b/lib/bb/tests/data.py
index 1d4a64b109..add1b13600 100644
--- a/lib/bb/tests/data.py
+++ b/lib/bb/tests/data.py
@@ -245,35 +245,35 @@ class TestConcatOverride(unittest.TestCase):
 
     def test_prepend(self):
         self.d.setVar("TEST", "${VAL}")
-        self.d.setVar("TEST_prepend", "${FOO}:")
+        self.d.setVar("TEST:prepend", "${FOO}:")
         self.assertEqual(self.d.getVar("TEST"), "foo:val")
 
     def test_append(self):
         self.d.setVar("TEST", "${VAL}")
-        self.d.setVar("TEST_append", ":${BAR}")
+        self.d.setVar("TEST:append", ":${BAR}")
         self.assertEqual(self.d.getVar("TEST"), "val:bar")
 
     def test_multiple_append(self):
         self.d.setVar("TEST", "${VAL}")
-        self.d.setVar("TEST_prepend", "${FOO}:")
-        self.d.setVar("TEST_append", ":val2")
-        self.d.setVar("TEST_append", ":${BAR}")
+        self.d.setVar("TEST:prepend", "${FOO}:")
+        self.d.setVar("TEST:append", ":val2")
+        self.d.setVar("TEST:append", ":${BAR}")
         self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
 
     def test_append_unset(self):
-        self.d.setVar("TEST_prepend", "${FOO}:")
-        self.d.setVar("TEST_append", ":val2")
-        self.d.setVar("TEST_append", ":${BAR}")
+        self.d.setVar("TEST:prepend", "${FOO}:")
+        self.d.setVar("TEST:append", ":val2")
+        self.d.setVar("TEST:append", ":${BAR}")
         self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar")
 
     def test_remove(self):
         self.d.setVar("TEST", "${VAL} ${BAR}")
-        self.d.setVar("TEST_remove", "val")
+        self.d.setVar("TEST:remove", "val")
         self.assertEqual(self.d.getVar("TEST"), " bar")
 
     def test_remove_cleared(self):
         self.d.setVar("TEST", "${VAL} ${BAR}")
-        self.d.setVar("TEST_remove", "val")
+        self.d.setVar("TEST:remove", "val")
         self.d.setVar("TEST", "${VAL} ${BAR}")
         self.assertEqual(self.d.getVar("TEST"), "val bar")
 
@@ -281,42 +281,42 @@ class TestConcatOverride(unittest.TestCase):
     # (including that whitespace is preserved)
     def test_remove_inactive_override(self):
         self.d.setVar("TEST", "${VAL} ${BAR}    123")
-        self.d.setVar("TEST_remove_inactiveoverride", "val")
+        self.d.setVar("TEST:remove_inactiveoverride", "val")
         self.assertEqual(self.d.getVar("TEST"), "val bar    123")
 
     def test_doubleref_remove(self):
         self.d.setVar("TEST", "${VAL} ${BAR}")
-        self.d.setVar("TEST_remove", "val")
+        self.d.setVar("TEST:remove", "val")
         self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
         self.assertEqual(self.d.getVar("TEST_TEST"), " bar  bar")
 
     def test_empty_remove(self):
         self.d.setVar("TEST", "")
-        self.d.setVar("TEST_remove", "val")
+        self.d.setVar("TEST:remove", "val")
         self.assertEqual(self.d.getVar("TEST"), "")
 
     def test_remove_expansion(self):
         self.d.setVar("BAR", "Z")
         self.d.setVar("TEST", "${BAR}/X Y")
-        self.d.setVar("TEST_remove", "${BAR}/X")
+        self.d.setVar("TEST:remove", "${BAR}/X")
         self.assertEqual(self.d.getVar("TEST"), " Y")
 
     def test_remove_expansion_items(self):
         self.d.setVar("TEST", "A B C D")
         self.d.setVar("BAR", "B D")
-        self.d.setVar("TEST_remove", "${BAR}")
+        self.d.setVar("TEST:remove", "${BAR}")
         self.assertEqual(self.d.getVar("TEST"), "A  C ")
 
     def test_remove_preserve_whitespace(self):
         # When the removal isn't active, the original value should be preserved
         self.d.setVar("TEST", " A B")
-        self.d.setVar("TEST_remove", "C")
+        self.d.setVar("TEST:remove", "C")
         self.assertEqual(self.d.getVar("TEST"), " A B")
 
     def test_remove_preserve_whitespace2(self):
         # When the removal is active preserve the whitespace
         self.d.setVar("TEST", " A B")
-        self.d.setVar("TEST_remove", "B")
+        self.d.setVar("TEST:remove", "B")
         self.assertEqual(self.d.getVar("TEST"), " A ")
 
 class TestOverrides(unittest.TestCase):
@@ -362,10 +362,10 @@ class TestOverrides(unittest.TestCase):
         self.assertEqual(self.d.getVar("TEST"), "testvalue3")
 
     def test_rename_override(self):
-        self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a")
+        self.d.setVar("ALTERNATIVE:ncurses-tools:class-target", "a")
         self.d.setVar("OVERRIDES", "class-target")
-        self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools")
-        self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools"), "a")
+        self.d.renameVar("ALTERNATIVE:ncurses-tools", "ALTERNATIVE:lib32-ncurses-tools")
+        self.assertEqual(self.d.getVar("ALTERNATIVE:lib32-ncurses-tools"), "a")
 
     def test_underscore_override(self):
         self.d.setVar("TEST_bar", "testvalue2")
@@ -377,22 +377,22 @@ class TestOverrides(unittest.TestCase):
     def test_remove_with_override(self):
         self.d.setVar("TEST_bar", "testvalue2")
         self.d.setVar("TEST_some_val", "testvalue3 testvalue5")
-        self.d.setVar("TEST_some_val_remove", "testvalue3")
+        self.d.setVar("TEST_some_val:remove", "testvalue3")
         self.d.setVar("TEST_foo", "testvalue4")
         self.d.setVar("OVERRIDES", "foo:bar:some_val")
         self.assertEqual(self.d.getVar("TEST"), " testvalue5")
 
     def test_append_and_override_1(self):
-        self.d.setVar("TEST_append", "testvalue2")
+        self.d.setVar("TEST:append", "testvalue2")
         self.d.setVar("TEST_bar", "testvalue3")
         self.assertEqual(self.d.getVar("TEST"), "testvalue3testvalue2")
 
     def test_append_and_override_2(self):
-        self.d.setVar("TEST_append_bar", "testvalue2")
+        self.d.setVar("TEST:append_bar", "testvalue2")
         self.assertEqual(self.d.getVar("TEST"), "testvaluetestvalue2")
 
     def test_append_and_override_3(self):
-        self.d.setVar("TEST_bar_append", "testvalue2")
+        self.d.setVar("TEST_bar:append", "testvalue2")
         self.assertEqual(self.d.getVar("TEST"), "testvalue2")
 
     # Test an override with _<numeric> in it based on a real world OE issue
@@ -400,7 +400,7 @@ class TestOverrides(unittest.TestCase):
         self.d.setVar("TARGET_ARCH", "x86_64")
         self.d.setVar("PN", "test-${TARGET_ARCH}")
         self.d.setVar("VERSION", "1")
-        self.d.setVar("VERSION_pn-test-${TARGET_ARCH}", "2")
+        self.d.setVar("VERSION:pn-test-${TARGET_ARCH}", "2")
         self.d.setVar("OVERRIDES", "pn-${PN}")
         bb.data.expandKeys(self.d)
         self.assertEqual(self.d.getVar("VERSION"), "2")
@@ -498,7 +498,7 @@ class TaskHash(unittest.TestCase):
         d.setVar("VAR", "val")
         # Adding an inactive removal shouldn't change the hash
         d.setVar("BAR", "notbar")
-        d.setVar("MYCOMMAND_remove", "${BAR}")
+        d.setVar("MYCOMMAND:remove", "${BAR}")
         nexthash = gettask_bashhash("mytask", d)
         self.assertEqual(orighash, nexthash)
 
diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
index 9e21e18425..02a5c4952a 100644
--- a/lib/bb/tests/parse.py
+++ b/lib/bb/tests/parse.py
@@ -98,8 +98,8 @@ exportD = "d"
 
 
     overridetest = """
-RRECOMMENDS_${PN} = "a"
-RRECOMMENDS_${PN}_libc = "b"
+RRECOMMENDS:${PN} = "a"
+RRECOMMENDS:${PN}_libc = "b"
 OVERRIDES = "libc:${PN}"
 PN = "gtk+"
 """
@@ -110,13 +110,13 @@ PN = "gtk+"
         self.assertEqual(d.getVar("RRECOMMENDS"), "b")
         bb.data.expandKeys(d)
         self.assertEqual(d.getVar("RRECOMMENDS"), "b")
-        d.setVar("RRECOMMENDS_gtk+", "c")
+        d.setVar("RRECOMMENDS:gtk+", "c")
         self.assertEqual(d.getVar("RRECOMMENDS"), "c")
 
     overridetest2 = """
 EXTRA_OECONF = ""
-EXTRA_OECONF_class-target = "b"
-EXTRA_OECONF_append = " c"
+EXTRA_OECONF:class-target = "b"
+EXTRA_OECONF:append = " c"
 """
 
     def test_parse_overrides(self):
@@ -128,7 +128,7 @@ EXTRA_OECONF_append = " c"
 
     overridetest3 = """
 DESCRIPTION = "A"
-DESCRIPTION_${PN}-dev = "${DESCRIPTION} B"
+DESCRIPTION:${PN}-dev = "${DESCRIPTION} B"
 PN = "bc"
 """
 
@@ -136,9 +136,9 @@ PN = "bc"
         f = self.parsehelper(self.overridetest3)
         d = bb.parse.handle(f.name, self.d)['']
         bb.data.expandKeys(d)
-        self.assertEqual(d.getVar("DESCRIPTION_bc-dev"), "A B")
+        self.assertEqual(d.getVar("DESCRIPTION:bc-dev"), "A B")
         d.setVar("DESCRIPTION", "E")
-        d.setVar("DESCRIPTION_bc-dev", "C D")
+        d.setVar("DESCRIPTION:bc-dev", "C D")
         d.setVar("OVERRIDES", "bc-dev")
         self.assertEqual(d.getVar("DESCRIPTION"), "C D")
 
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 7f7e922ade..4c94b407d7 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -1719,7 +1719,7 @@ class CustomImageRecipe(Recipe):
         """Generate the contents for the recipe file."""
         # If we have no excluded packages we only need to _append
         if self.excludes_set.count() == 0:
-            packages_conf = "IMAGE_INSTALL_append = \" "
+            packages_conf = "IMAGE_INSTALL:append = \" "
 
             for pkg in self.appends_set.all():
                 packages_conf += pkg.name+' '
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 9a5e48e3bb..04ab8bcb04 100644
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -1708,7 +1708,7 @@ if True:
             except ProjectVariable.DoesNotExist:
                 pass
             try:
-                return_data['image_install_append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value,
+                return_data['image_install:append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL:append").value,
             except ProjectVariable.DoesNotExist:
                 pass
             try:
@@ -1839,8 +1839,8 @@ if True:
         except ProjectVariable.DoesNotExist:
             pass
         try:
-            context['image_install_append'] =  ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value
-            context['image_install_append_defined'] = "1"
+            context['image_install:append'] =  ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL:append").value
+            context['image_install:append_defined'] = "1"
         except ProjectVariable.DoesNotExist:
             pass
         try:
diff --git a/lib/toaster/toastermain/management/commands/buildimport.py b/lib/toaster/toastermain/management/commands/buildimport.py
index 59da6ff7ac..e25b55e5ab 100644
--- a/lib/toaster/toastermain/management/commands/buildimport.py
+++ b/lib/toaster/toastermain/management/commands/buildimport.py
@@ -451,7 +451,7 @@ class Command(BaseCommand):
             # Catch vars relevant to Toaster (in case no Toaster section)
             self.update_project_vars(project,'DISTRO')
             self.update_project_vars(project,'MACHINE')
-            self.update_project_vars(project,'IMAGE_INSTALL_append')
+            self.update_project_vars(project,'IMAGE_INSTALL:append')
             self.update_project_vars(project,'IMAGE_FSTYPES')
             self.update_project_vars(project,'PACKAGE_CLASSES')
             # These vars are typically only assigned by Toaster
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion
  2021-07-30 13:47 [PATCH 1/4] bitbake: Switch to using new override syntax Richard Purdie
  2021-07-30 13:47 ` [PATCH 2/4] doc/lib: Update to use new override syntax containing colons Richard Purdie
@ 2021-07-30 13:47 ` Richard Purdie
  2021-07-30 14:11   ` [bitbake-devel] " Quentin Schulz
  2021-08-02 22:09   ` Quentin Schulz
  2021-07-30 13:47 ` [PATCH 4/4] bitbake: Update to version 1.51.1 Richard Purdie
  2021-07-30 14:24 ` [bitbake-devel] [PATCH 1/4] bitbake: Switch to using new override syntax Martin Jansa
  3 siblings, 2 replies; 13+ messages in thread
From: Richard Purdie @ 2021-07-30 13:47 UTC (permalink / raw)
  To: bitbake-devel

The examples and tests use non-standard override names, convert these to
the new syntax by hand.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../bitbake-user-manual-metadata.rst          | 24 +++++-----
 lib/bb/tests/data.py                          | 46 +++++++++----------
 lib/bb/tests/parse.py                         |  2 +-
 3 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index db44e26fbd..372926064a 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -551,7 +551,7 @@ variable.
 
       DEPENDS = "glibc ncurses"
       OVERRIDES = "machine:local"
-      DEPENDS:append_machine = "libmad"
+      DEPENDS:append:machine = "libmad"
 
    In this example, :term:`DEPENDS` becomes "glibc ncurses libmad".
 
@@ -618,27 +618,27 @@ example::
 
    OVERRIDES = "foo"
    A = "Z"
-   A_foo:append = "X"
+   A:foo:append = "X"
 
 For this case,
 ``A`` is unconditionally set to "Z" and "X" is unconditionally and
-immediately appended to the variable ``A_foo``. Because overrides have
-not been applied yet, ``A_foo`` is set to "X" due to the append and
+immediately appended to the variable ``A:foo``. Because overrides have
+not been applied yet, ``A:foo`` is set to "X" due to the append and
 ``A`` simply equals "Z".
 
 Applying overrides, however, changes things. Since "foo" is listed in
 :term:`OVERRIDES`, the conditional variable ``A`` is replaced with the "foo"
-version, which is equal to "X". So effectively, ``A_foo`` replaces
+version, which is equal to "X". So effectively, ``A:foo`` replaces
 ``A``.
 
 This next example changes the order of the override and the append::
 
    OVERRIDES = "foo"
    A = "Z"
-   A:append_foo = "X"
+   A:append:foo = "X"
 
 For this case, before
-overrides are handled, ``A`` is set to "Z" and ``A_append_foo`` is set
+overrides are handled, ``A`` is set to "Z" and ``A:append:foo`` is set
 to "X". Once the override for "foo" is applied, however, ``A`` gets
 appended with "X". Consequently, ``A`` becomes "ZX". Notice that spaces
 are not appended.
@@ -648,15 +648,15 @@ back as in the first example::
 
    OVERRIDES = "foo"
    A = "Y"
-   A_foo:append = "Z"
-   A_foo:append = "X"
+   A:foo:append = "Z"
+   A:foo:append = "X"
 
 For this case, before any overrides are resolved,
 ``A`` is set to "Y" using an immediate assignment. After this immediate
-assignment, ``A_foo`` is set to "Z", and then further appended with "X"
+assignment, ``A:foo`` is set to "Z", and then further appended with "X"
 leaving the variable set to "ZX". Finally, applying the override for
 "foo" results in the conditional variable ``A`` becoming "ZX" (i.e.
-``A`` is replaced with ``A_foo``).
+``A`` is replaced with ``A:foo``).
 
 This final example mixes in some varying operators::
 
@@ -752,7 +752,7 @@ parsed. One way to achieve a conditional inherit in this case is to use
 overrides::
 
    VARIABLE = ""
-   VARIABLE_someoverride = "myclass"
+   VARIABLE:someoverride = "myclass"
 
 Another method is by using anonymous Python. Here is an example::
 
diff --git a/lib/bb/tests/data.py b/lib/bb/tests/data.py
index add1b13600..7f1d3ffbbc 100644
--- a/lib/bb/tests/data.py
+++ b/lib/bb/tests/data.py
@@ -281,7 +281,7 @@ class TestConcatOverride(unittest.TestCase):
     # (including that whitespace is preserved)
     def test_remove_inactive_override(self):
         self.d.setVar("TEST", "${VAL} ${BAR}    123")
-        self.d.setVar("TEST:remove_inactiveoverride", "val")
+        self.d.setVar("TEST:remove:inactiveoverride", "val")
         self.assertEqual(self.d.getVar("TEST"), "val bar    123")
 
     def test_doubleref_remove(self):
@@ -329,35 +329,35 @@ class TestOverrides(unittest.TestCase):
         self.assertEqual(self.d.getVar("TEST"), "testvalue")
 
     def test_one_override(self):
-        self.d.setVar("TEST_bar", "testvalue2")
+        self.d.setVar("TEST:bar", "testvalue2")
         self.assertEqual(self.d.getVar("TEST"), "testvalue2")
 
     def test_one_override_unset(self):
-        self.d.setVar("TEST2_bar", "testvalue2")
+        self.d.setVar("TEST2:bar", "testvalue2")
 
         self.assertEqual(self.d.getVar("TEST2"), "testvalue2")
-        self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST2', 'OVERRIDES', 'TEST2_bar'])
+        self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST2', 'OVERRIDES', 'TEST2:bar'])
 
     def test_multiple_override(self):
-        self.d.setVar("TEST_bar", "testvalue2")
-        self.d.setVar("TEST_local", "testvalue3")
-        self.d.setVar("TEST_foo", "testvalue4")
+        self.d.setVar("TEST:bar", "testvalue2")
+        self.d.setVar("TEST:local", "testvalue3")
+        self.d.setVar("TEST:foo", "testvalue4")
         self.assertEqual(self.d.getVar("TEST"), "testvalue3")
-        self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST_foo', 'OVERRIDES', 'TEST_bar', 'TEST_local'])
+        self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST:foo', 'OVERRIDES', 'TEST:bar', 'TEST:local'])
 
     def test_multiple_combined_overrides(self):
-        self.d.setVar("TEST_local_foo_bar", "testvalue3")
+        self.d.setVar("TEST:local:foo:bar", "testvalue3")
         self.assertEqual(self.d.getVar("TEST"), "testvalue3")
 
     def test_multiple_overrides_unset(self):
-        self.d.setVar("TEST2_local_foo_bar", "testvalue3")
+        self.d.setVar("TEST2:local:foo:bar", "testvalue3")
         self.assertEqual(self.d.getVar("TEST2"), "testvalue3")
 
     def test_keyexpansion_override(self):
         self.d.setVar("LOCAL", "local")
-        self.d.setVar("TEST_bar", "testvalue2")
-        self.d.setVar("TEST_${LOCAL}", "testvalue3")
-        self.d.setVar("TEST_foo", "testvalue4")
+        self.d.setVar("TEST:bar", "testvalue2")
+        self.d.setVar("TEST:${LOCAL}", "testvalue3")
+        self.d.setVar("TEST:foo", "testvalue4")
         bb.data.expandKeys(self.d)
         self.assertEqual(self.d.getVar("TEST"), "testvalue3")
 
@@ -368,31 +368,31 @@ class TestOverrides(unittest.TestCase):
         self.assertEqual(self.d.getVar("ALTERNATIVE:lib32-ncurses-tools"), "a")
 
     def test_underscore_override(self):
-        self.d.setVar("TEST_bar", "testvalue2")
-        self.d.setVar("TEST_some_val", "testvalue3")
-        self.d.setVar("TEST_foo", "testvalue4")
+        self.d.setVar("TEST:bar", "testvalue2")
+        self.d.setVar("TEST:some_val", "testvalue3")
+        self.d.setVar("TEST:foo", "testvalue4")
         self.d.setVar("OVERRIDES", "foo:bar:some_val")
         self.assertEqual(self.d.getVar("TEST"), "testvalue3")
 
     def test_remove_with_override(self):
-        self.d.setVar("TEST_bar", "testvalue2")
-        self.d.setVar("TEST_some_val", "testvalue3 testvalue5")
-        self.d.setVar("TEST_some_val:remove", "testvalue3")
-        self.d.setVar("TEST_foo", "testvalue4")
+        self.d.setVar("TEST:bar", "testvalue2")
+        self.d.setVar("TEST:some_val", "testvalue3 testvalue5")
+        self.d.setVar("TEST:some_val:remove", "testvalue3")
+        self.d.setVar("TEST:foo", "testvalue4")
         self.d.setVar("OVERRIDES", "foo:bar:some_val")
         self.assertEqual(self.d.getVar("TEST"), " testvalue5")
 
     def test_append_and_override_1(self):
         self.d.setVar("TEST:append", "testvalue2")
-        self.d.setVar("TEST_bar", "testvalue3")
+        self.d.setVar("TEST:bar", "testvalue3")
         self.assertEqual(self.d.getVar("TEST"), "testvalue3testvalue2")
 
     def test_append_and_override_2(self):
-        self.d.setVar("TEST:append_bar", "testvalue2")
+        self.d.setVar("TEST:append:bar", "testvalue2")
         self.assertEqual(self.d.getVar("TEST"), "testvaluetestvalue2")
 
     def test_append_and_override_3(self):
-        self.d.setVar("TEST_bar:append", "testvalue2")
+        self.d.setVar("TEST:bar:append", "testvalue2")
         self.assertEqual(self.d.getVar("TEST"), "testvalue2")
 
     # Test an override with _<numeric> in it based on a real world OE issue
diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
index 02a5c4952a..1b6b6d412e 100644
--- a/lib/bb/tests/parse.py
+++ b/lib/bb/tests/parse.py
@@ -144,7 +144,7 @@ PN = "bc"
 
 
     classextend = """
-VAR_var_override1 = "B"
+VAR_var:override1 = "B"
 EXTRA = ":override1"
 OVERRIDES = "nothing${EXTRA}"
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/4] bitbake: Update to version 1.51.1
  2021-07-30 13:47 [PATCH 1/4] bitbake: Switch to using new override syntax Richard Purdie
  2021-07-30 13:47 ` [PATCH 2/4] doc/lib: Update to use new override syntax containing colons Richard Purdie
  2021-07-30 13:47 ` [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion Richard Purdie
@ 2021-07-30 13:47 ` Richard Purdie
  2021-07-30 14:24 ` [bitbake-devel] [PATCH 1/4] bitbake: Switch to using new override syntax Martin Jansa
  3 siblings, 0 replies; 13+ messages in thread
From: Richard Purdie @ 2021-07-30 13:47 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 bin/bitbake        | 2 +-
 lib/bb/__init__.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/bitbake b/bin/bitbake
index f0ff2400fc..dc1873af69 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -26,7 +26,7 @@ from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
 if sys.getfilesystemencoding() != "utf-8":
     sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.")
 
-__version__ = "1.51.0"
+__version__ = "1.51.1"
 
 if __name__ == "__main__":
     if __version__ != bb.__version__:
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index a144bd609a..c1e30697b3 100644
--- a/lib/bb/__init__.py
+++ b/lib/bb/__init__.py
@@ -9,7 +9,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 #
 
-__version__ = "1.51.0"
+__version__ = "1.51.1"
 
 import sys
 if sys.version_info < (3, 5, 0):
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 2/4] doc/lib: Update to use new override syntax containing colons
  2021-07-30 13:47 ` [PATCH 2/4] doc/lib: Update to use new override syntax containing colons Richard Purdie
@ 2021-07-30 14:08   ` Quentin Schulz
  2021-07-30 14:11     ` Richard Purdie
  0 siblings, 1 reply; 13+ messages in thread
From: Quentin Schulz @ 2021-07-30 14:08 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

Hi Richard,

On Fri, Jul 30, 2021 at 02:47:04PM +0100, Richard Purdie wrote:
> This runs the overrides conversion script in OE-Core over the bitbake code
> base including the docs. A handful of things were excluded in toaster
> and for the Changelog file.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  contrib/vim/plugin/newbbappend.vim            |  2 +-
>  .../bitbake-user-manual-metadata.rst          | 64 +++++++++----------
>  .../bitbake-user-manual-ref-variables.rst     | 14 ++--
>  lib/bb/fetch2/__init__.py                     |  2 +-
>  lib/bb/tests/data.py                          | 52 +++++++--------
>  lib/bb/tests/parse.py                         | 16 ++---
>  lib/toaster/orm/models.py                     |  2 +-
>  lib/toaster/toastergui/views.py               |  6 +-
>  .../management/commands/buildimport.py        |  2 +-
>  9 files changed, 80 insertions(+), 80 deletions(-)
> 
> diff --git a/contrib/vim/plugin/newbbappend.vim b/contrib/vim/plugin/newbbappend.vim
> index e04174cf62..3f65f79cdc 100644
> --- a/contrib/vim/plugin/newbbappend.vim
> +++ b/contrib/vim/plugin/newbbappend.vim
> @@ -20,7 +20,7 @@ fun! NewBBAppendTemplate()
>      set nopaste
>  
>      " New bbappend template
> -    0 put ='FILESEXTRAPATHS_prepend := \"${THISDIR}/${PN}:\"'
> +    0 put ='FILESEXTRAPATHS:prepend := \"${THISDIR}/${PN}:\"'
>      2
>  
>      if paste == 1
> diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> index 3e14163ebe..db44e26fbd 100644
> --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> @@ -281,11 +281,11 @@ operators in that their effects are applied at variable expansion time
>  rather than being immediately applied. Here are some examples::
>  
>     B = "bval"
> -   B_append = " additional data"
> +   B:append = " additional data"
>     C = "cval"
> -   C_prepend = "additional data "
> +   C:prepend = "additional data "
>     D = "dval"
> -   D_append = "additional data"
> +   D:append = "additional data"
>  
>  The variable :term:`B`
>  becomes "bval additional data" and ``C`` becomes "additional data cval".
> @@ -312,10 +312,10 @@ When you use this syntax, BitBake expects one or more strings.
>  Surrounding spaces and spacing are preserved. Here is an example::
>  
>     FOO = "123 456 789 123456 123 456 123 456"
> -   FOO_remove = "123"
> -   FOO_remove = "456"
> +   FOO:remove = "123"
> +   FOO:remove = "456"
>     FOO2 = " abc def ghi abcdef abc def abc def def"
> -   FOO2_remove = "\
> +   FOO2:remove = "\
>         def \
>         abc \
>         ghi \
> @@ -349,15 +349,15 @@ If, on the other hand, ``foo.bbclass``
>  uses the "_append" operator, then the final value of ``FOO`` will be
>  "initial val", as intended::
>  
> -   FOO_append = " val"
> +   FOO:append = " val"
>  
>  .. note::
>  
>     It is never necessary to use "+=" together with "_append". The following
>     sequence of assignments appends "barbaz" to FOO::
>  
> -       FOO_append = "bar"
> -       FOO_append = "baz"
> +       FOO:append = "bar"
> +       FOO:append = "baz"
>  
>  
>     The only effect of changing the second assignment in the previous
> @@ -538,12 +538,12 @@ variable.
>     that value based on the architecture of the build::
>  
>        KBRANCH = "standard/base"
> -      KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
> -      KBRANCH_qemumips = "standard/mti-malta32"
> -      KBRANCH_qemuppc = "standard/qemuppc"
> -      KBRANCH_qemux86 = "standard/common-pc/base"
> -      KBRANCH_qemux86-64 = "standard/common-pc-64/base"
> -      KBRANCH_qemumips64 = "standard/mti-malta64"
> +      KBRANCH:qemuarm = "standard/arm-versatile-926ejs"
> +      KBRANCH:qemumips = "standard/mti-malta32"
> +      KBRANCH:qemuppc = "standard/qemuppc"
> +      KBRANCH:qemux86 = "standard/common-pc/base"
> +      KBRANCH:qemux86-64 = "standard/common-pc-64/base"
> +      KBRANCH:qemumips64 = "standard/mti-malta64"
>  
>  -  *Appending and Prepending:* BitBake also supports append and prepend
>     operations to variable values based on whether a specific item is
> @@ -551,7 +551,7 @@ variable.
>  
>        DEPENDS = "glibc ncurses"
>        OVERRIDES = "machine:local"
> -      DEPENDS_append_machine = "libmad"
> +      DEPENDS:append_machine = "libmad"
>  

s/DEPENDS:append_machine/DEPENDS:append:machine/

>     In this example, :term:`DEPENDS` becomes "glibc ncurses libmad".
>  
> @@ -559,15 +559,15 @@ variable.
>     example, the following lines will conditionally append to the
>     ``KERNEL_FEATURES`` variable based on the architecture::
>  
> -      KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
> -      KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
> -      KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
> +      KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"
> +      KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
> +      KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
>  
>  -  *Setting a Variable for a Single Task:* BitBake supports setting a
>     variable just for the duration of a single task. Here is an example::
>  
>        FOO_task-configure = "val 1"
> -      FOO_task-compile = "val 2"
> +      FOO:task-compile = "val 2"
>  
>     In the
>     previous example, ``FOO`` has the value "val 1" while the
> @@ -582,7 +582,7 @@ variable.
>     You can also use this syntax with other combinations (e.g.
>     "``_prepend``") as shown in the following example::
>  
> -      EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
> +      EXTRA_OEMAKE:prepend:task-compile = "${PARALLEL_MAKE} "
>  
>  Key Expansion
>  -------------
> @@ -618,7 +618,7 @@ example::
>  
>     OVERRIDES = "foo"
>     A = "Z"
> -   A_foo_append = "X"
> +   A_foo:append = "X"
>  

s/A_foo:append/A:foo:append/

>  For this case,
>  ``A`` is unconditionally set to "Z" and "X" is unconditionally and
> @@ -635,7 +635,7 @@ This next example changes the order of the override and the append::
>  
>     OVERRIDES = "foo"
>     A = "Z"
> -   A_append_foo = "X"
> +   A:append_foo = "X"
>  

s/A:append_foo/A:append:foo/

>  For this case, before
>  overrides are handled, ``A`` is set to "Z" and ``A_append_foo`` is set
> @@ -648,8 +648,8 @@ back as in the first example::
>  
>     OVERRIDES = "foo"
>     A = "Y"
> -   A_foo_append = "Z"
> -   A_foo_append = "X"
> +   A_foo:append = "Z"
> +   A_foo:append = "X"

(twice)
s/A_foo:append/A:foo:append/

>  
>  For this case, before any overrides are resolved,
>  ``A`` is set to "Y" using an immediate assignment. After this immediate
> @@ -661,8 +661,8 @@ leaving the variable set to "ZX". Finally, applying the override for
>  This final example mixes in some varying operators::
>  
>     A = "1"
> -   A_append = "2"
> -   A_append = "3"
> +   A:append = "2"
> +   A:append = "3"
>     A += "4"
>     A .= "5"
>  
> @@ -919,7 +919,7 @@ As an example, consider the following::
>         fn
>     }
>  
> -   fn_prepend() {
> +   fn:prepend() {
>         bbplain second
>     }
>  
> @@ -927,7 +927,7 @@ As an example, consider the following::
>         bbplain third
>     }
>  
> -   do_foo_append() {
> +   do_foo:append() {
>         bbplain fourth
>     }
>  
> @@ -977,7 +977,7 @@ override-style operators to BitBake-style Python functions.
>  
>  As an example, consider the following::
>  
> -   python do_foo_prepend() {
> +   python do_foo:prepend() {
>         bb.plain("first")
>     }
>  
> @@ -985,7 +985,7 @@ As an example, consider the following::
>         bb.plain("second")
>     }
>  
> -   python do_foo_append() {
> +   python do_foo:append() {
>         bb.plain("third")
>     }
>  
> @@ -1139,7 +1139,7 @@ before anonymous functions run. In the following example, ``FOO`` ends
>  up with the value "foo from anonymous"::
>  
>     FOO = "foo"
> -   FOO_append = " from outside"
> +   FOO:append = " from outside"
>  
>     python () {
>         d.setVar("FOO", "foo from anonymous")
> diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> index 797e2a00cc..6283c2654c 100644
> --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> @@ -1118,7 +1118,7 @@ overview of their function and contents.
>        attempt before any others by adding something like the following to
>        your configuration::
>  
> -         PREMIRRORS_prepend = "\
> +         PREMIRRORS:prepend = "\
>           git://.*/.* https://urldefense.proofpoint.com/v2/url?u=http-3A__www.yoctoproject.org_sources_&d=DwIDAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=3rKsf74xytksTpeIDY38SreNfv_q7CH9lMzWrDyrDww&s=0Xmf3ZFDICOxHg5sSg9Yyah6SmQ98MqFziI7C9y5Ut4&e=  \n \
>           https://urldefense.proofpoint.com/v2/url?u=ftp-3A__.-2A_.-2A&d=DwIDAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=3rKsf74xytksTpeIDY38SreNfv_q7CH9lMzWrDyrDww&s=50pkHuxtmu2aYHIsnUDCDKjuyK-dIlYAiLn0UQ0zGQo&e=  https://urldefense.proofpoint.com/v2/url?u=http-3A__www.yoctoproject.org_sources_&d=DwIDAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=3rKsf74xytksTpeIDY38SreNfv_q7CH9lMzWrDyrDww&s=0Xmf3ZFDICOxHg5sSg9Yyah6SmQ98MqFziI7C9y5Ut4&e=  \n \
>           https://urldefense.proofpoint.com/v2/url?u=http-3A__.-2A_.-2A&d=DwIDAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=3rKsf74xytksTpeIDY38SreNfv_q7CH9lMzWrDyrDww&s=JGR-zjI5yaKOOxKRmm9r6WQFVVUB7F1tAxNdtLvsAgg&e=  https://urldefense.proofpoint.com/v2/url?u=http-3A__www.yoctoproject.org_sources_&d=DwIDAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=3rKsf74xytksTpeIDY38SreNfv_q7CH9lMzWrDyrDww&s=0Xmf3ZFDICOxHg5sSg9Yyah6SmQ98MqFziI7C9y5Ut4&e=  \n \
> @@ -1184,7 +1184,7 @@ overview of their function and contents.
>        that depends on the ``perl`` package. In this case, you would use the
>        following :term:`RDEPENDS` statement::
>  
> -         RDEPENDS_${PN}-dev += "perl"
> +         RDEPENDS:${PN}-dev += "perl"
>  
>        In the example, the development package depends on the ``perl`` package.
>        Thus, the :term:`RDEPENDS` variable has the ``${PN}-dev`` package name as part
> @@ -1195,7 +1195,7 @@ overview of their function and contents.
>        differences from you. Here is the general syntax to specify versions
>        with the :term:`RDEPENDS` variable::
>  
> -         RDEPENDS_${PN} = "package (operator version)"
> +         RDEPENDS:${PN} = "package (operator version)"
>  
>        For ``operator``, you can specify the following::
>  
> @@ -1208,7 +1208,7 @@ overview of their function and contents.
>        For example, the following sets up a dependency on version 1.2 or
>        greater of the package ``foo``::
>  
> -         RDEPENDS_${PN} = "foo (>= 1.2)"
> +         RDEPENDS:${PN} = "foo (>= 1.2)"
>  
>        For information on build-time dependencies, see the :term:`DEPENDS`
>        variable.
> @@ -1237,7 +1237,7 @@ overview of their function and contents.
>        variable in conjunction with a package name override. Here is an
>        example::
>  
> -         RPROVIDES_${PN} = "widget-abi-2"
> +         RPROVIDES:${PN} = "widget-abi-2"
>  
>     :term:`RRECOMMENDS`
>        A list of packages that extends the usability of a package being
> @@ -1251,7 +1251,7 @@ overview of their function and contents.
>        differences from you. Here is the general syntax to specify versions
>        with the :term:`RRECOMMENDS` variable::
>  
> -         RRECOMMENDS_${PN} = "package (operator version)"
> +         RRECOMMENDS:${PN} = "package (operator version)"
>  
>        For ``operator``, you can specify the following::
>  
> @@ -1264,7 +1264,7 @@ overview of their function and contents.
>        For example, the following sets up a recommend on version
>        1.2 or greater of the package ``foo``::
>  
> -         RRECOMMENDS_${PN} = "foo (>= 1.2)"
> +         RRECOMMENDS:${PN} = "foo (>= 1.2)"
>  
>     :term:`SECTION`
>        The section in which packages should be categorized.
> diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
> index 0d49e1da37..60aaf3902a 100644
> --- a/lib/bb/fetch2/__init__.py
> +++ b/lib/bb/fetch2/__init__.py
> @@ -1150,7 +1150,7 @@ def srcrev_internal_helper(ud, d, name):
>      if name != '':
>          attempts.append("SRCREV_%s" % name)

s/SRCREV_%s/SRCREV:%s/ ?

>      if pn:
> -        attempts.append("SRCREV_pn-%s" % pn)
> +        attempts.append("SRCREV:pn-%s" % pn)
>      attempts.append("SRCREV")
>  
>      for a in attempts:
> diff --git a/lib/bb/tests/data.py b/lib/bb/tests/data.py
> index 1d4a64b109..add1b13600 100644
> --- a/lib/bb/tests/data.py
> +++ b/lib/bb/tests/data.py
> @@ -245,35 +245,35 @@ class TestConcatOverride(unittest.TestCase):
>  
>      def test_prepend(self):
>          self.d.setVar("TEST", "${VAL}")
> -        self.d.setVar("TEST_prepend", "${FOO}:")
> +        self.d.setVar("TEST:prepend", "${FOO}:")
>          self.assertEqual(self.d.getVar("TEST"), "foo:val")
>  
>      def test_append(self):
>          self.d.setVar("TEST", "${VAL}")
> -        self.d.setVar("TEST_append", ":${BAR}")
> +        self.d.setVar("TEST:append", ":${BAR}")
>          self.assertEqual(self.d.getVar("TEST"), "val:bar")
>  
>      def test_multiple_append(self):
>          self.d.setVar("TEST", "${VAL}")
> -        self.d.setVar("TEST_prepend", "${FOO}:")
> -        self.d.setVar("TEST_append", ":val2")
> -        self.d.setVar("TEST_append", ":${BAR}")
> +        self.d.setVar("TEST:prepend", "${FOO}:")
> +        self.d.setVar("TEST:append", ":val2")
> +        self.d.setVar("TEST:append", ":${BAR}")
>          self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
>  
>      def test_append_unset(self):
> -        self.d.setVar("TEST_prepend", "${FOO}:")
> -        self.d.setVar("TEST_append", ":val2")
> -        self.d.setVar("TEST_append", ":${BAR}")
> +        self.d.setVar("TEST:prepend", "${FOO}:")
> +        self.d.setVar("TEST:append", ":val2")
> +        self.d.setVar("TEST:append", ":${BAR}")
>          self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar")
>  
>      def test_remove(self):
>          self.d.setVar("TEST", "${VAL} ${BAR}")
> -        self.d.setVar("TEST_remove", "val")
> +        self.d.setVar("TEST:remove", "val")
>          self.assertEqual(self.d.getVar("TEST"), " bar")
>  
>      def test_remove_cleared(self):
>          self.d.setVar("TEST", "${VAL} ${BAR}")
> -        self.d.setVar("TEST_remove", "val")
> +        self.d.setVar("TEST:remove", "val")
>          self.d.setVar("TEST", "${VAL} ${BAR}")
>          self.assertEqual(self.d.getVar("TEST"), "val bar")
>  
> @@ -281,42 +281,42 @@ class TestConcatOverride(unittest.TestCase):
>      # (including that whitespace is preserved)
>      def test_remove_inactive_override(self):
>          self.d.setVar("TEST", "${VAL} ${BAR}    123")
> -        self.d.setVar("TEST_remove_inactiveoverride", "val")
> +        self.d.setVar("TEST:remove_inactiveoverride", "val")
>          self.assertEqual(self.d.getVar("TEST"), "val bar    123")
>  
>      def test_doubleref_remove(self):
>          self.d.setVar("TEST", "${VAL} ${BAR}")
> -        self.d.setVar("TEST_remove", "val")
> +        self.d.setVar("TEST:remove", "val")
>          self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
>          self.assertEqual(self.d.getVar("TEST_TEST"), " bar  bar")
>  
>      def test_empty_remove(self):
>          self.d.setVar("TEST", "")
> -        self.d.setVar("TEST_remove", "val")
> +        self.d.setVar("TEST:remove", "val")
>          self.assertEqual(self.d.getVar("TEST"), "")
>  
>      def test_remove_expansion(self):
>          self.d.setVar("BAR", "Z")
>          self.d.setVar("TEST", "${BAR}/X Y")
> -        self.d.setVar("TEST_remove", "${BAR}/X")
> +        self.d.setVar("TEST:remove", "${BAR}/X")
>          self.assertEqual(self.d.getVar("TEST"), " Y")
>  
>      def test_remove_expansion_items(self):
>          self.d.setVar("TEST", "A B C D")
>          self.d.setVar("BAR", "B D")
> -        self.d.setVar("TEST_remove", "${BAR}")
> +        self.d.setVar("TEST:remove", "${BAR}")
>          self.assertEqual(self.d.getVar("TEST"), "A  C ")
>  
>      def test_remove_preserve_whitespace(self):
>          # When the removal isn't active, the original value should be preserved
>          self.d.setVar("TEST", " A B")
> -        self.d.setVar("TEST_remove", "C")
> +        self.d.setVar("TEST:remove", "C")
>          self.assertEqual(self.d.getVar("TEST"), " A B")
>  
>      def test_remove_preserve_whitespace2(self):
>          # When the removal is active preserve the whitespace
>          self.d.setVar("TEST", " A B")
> -        self.d.setVar("TEST_remove", "B")
> +        self.d.setVar("TEST:remove", "B")
>          self.assertEqual(self.d.getVar("TEST"), " A ")
>  
>  class TestOverrides(unittest.TestCase):
> @@ -362,10 +362,10 @@ class TestOverrides(unittest.TestCase):
>          self.assertEqual(self.d.getVar("TEST"), "testvalue3")
>  
>      def test_rename_override(self):
> -        self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a")
> +        self.d.setVar("ALTERNATIVE:ncurses-tools:class-target", "a")
>          self.d.setVar("OVERRIDES", "class-target")
> -        self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools")
> -        self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools"), "a")
> +        self.d.renameVar("ALTERNATIVE:ncurses-tools", "ALTERNATIVE:lib32-ncurses-tools")
> +        self.assertEqual(self.d.getVar("ALTERNATIVE:lib32-ncurses-tools"), "a")
>  
>      def test_underscore_override(self):
>          self.d.setVar("TEST_bar", "testvalue2")
> @@ -377,22 +377,22 @@ class TestOverrides(unittest.TestCase):
>      def test_remove_with_override(self):
>          self.d.setVar("TEST_bar", "testvalue2")

s/TEST_bar/TEST:bar/ ?

>          self.d.setVar("TEST_some_val", "testvalue3 testvalue5")

s/TEST_some_val/TEST:some_val/ ?

> -        self.d.setVar("TEST_some_val_remove", "testvalue3")
> +        self.d.setVar("TEST_some_val:remove", "testvalue3")

s/TEST_some_val:remove/TEST:some_val:remove/ ?

>          self.d.setVar("TEST_foo", "testvalue4")

s/TEST_foo/TEST:foo/ ?

>          self.d.setVar("OVERRIDES", "foo:bar:some_val")
>          self.assertEqual(self.d.getVar("TEST"), " testvalue5")
>  
>      def test_append_and_override_1(self):
> -        self.d.setVar("TEST_append", "testvalue2")
> +        self.d.setVar("TEST:append", "testvalue2")
>          self.d.setVar("TEST_bar", "testvalue3")

s/TEST_bar/TEST:bar/ ?

>          self.assertEqual(self.d.getVar("TEST"), "testvalue3testvalue2")
>  
>      def test_append_and_override_2(self):
> -        self.d.setVar("TEST_append_bar", "testvalue2")
> +        self.d.setVar("TEST:append_bar", "testvalue2")

s/TEST:append_bar/TEST:append:bar/ ?

>          self.assertEqual(self.d.getVar("TEST"), "testvaluetestvalue2")
>  
>      def test_append_and_override_3(self):
> -        self.d.setVar("TEST_bar_append", "testvalue2")
> +        self.d.setVar("TEST_bar:append", "testvalue2")

s/TEST_bar:append/TEST:bar:append/ ?

>          self.assertEqual(self.d.getVar("TEST"), "testvalue2")
>  
>      # Test an override with _<numeric> in it based on a real world OE issue
> @@ -400,7 +400,7 @@ class TestOverrides(unittest.TestCase):
>          self.d.setVar("TARGET_ARCH", "x86_64")
>          self.d.setVar("PN", "test-${TARGET_ARCH}")
>          self.d.setVar("VERSION", "1")
> -        self.d.setVar("VERSION_pn-test-${TARGET_ARCH}", "2")
> +        self.d.setVar("VERSION:pn-test-${TARGET_ARCH}", "2")
>          self.d.setVar("OVERRIDES", "pn-${PN}")
>          bb.data.expandKeys(self.d)
>          self.assertEqual(self.d.getVar("VERSION"), "2")
> @@ -498,7 +498,7 @@ class TaskHash(unittest.TestCase):
>          d.setVar("VAR", "val")
>          # Adding an inactive removal shouldn't change the hash
>          d.setVar("BAR", "notbar")
> -        d.setVar("MYCOMMAND_remove", "${BAR}")
> +        d.setVar("MYCOMMAND:remove", "${BAR}")
>          nexthash = gettask_bashhash("mytask", d)
>          self.assertEqual(orighash, nexthash)
>  
> diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
> index 9e21e18425..02a5c4952a 100644
> --- a/lib/bb/tests/parse.py
> +++ b/lib/bb/tests/parse.py
> @@ -98,8 +98,8 @@ exportD = "d"
>  
>  
>      overridetest = """
> -RRECOMMENDS_${PN} = "a"
> -RRECOMMENDS_${PN}_libc = "b"
> +RRECOMMENDS:${PN} = "a"
> +RRECOMMENDS:${PN}_libc = "b"

s/RRECOMMENDS:${PN}_libc/RRECOMMENDS:${PN}:libc/ ?

>  OVERRIDES = "libc:${PN}"
>  PN = "gtk+"
>  """
> @@ -110,13 +110,13 @@ PN = "gtk+"
>          self.assertEqual(d.getVar("RRECOMMENDS"), "b")
>          bb.data.expandKeys(d)
>          self.assertEqual(d.getVar("RRECOMMENDS"), "b")
> -        d.setVar("RRECOMMENDS_gtk+", "c")
> +        d.setVar("RRECOMMENDS:gtk+", "c")
>          self.assertEqual(d.getVar("RRECOMMENDS"), "c")
>  
>      overridetest2 = """
>  EXTRA_OECONF = ""
> -EXTRA_OECONF_class-target = "b"
> -EXTRA_OECONF_append = " c"
> +EXTRA_OECONF:class-target = "b"
> +EXTRA_OECONF:append = " c"
>  """
>  
>      def test_parse_overrides(self):
> @@ -128,7 +128,7 @@ EXTRA_OECONF_append = " c"
>  
>      overridetest3 = """
>  DESCRIPTION = "A"
> -DESCRIPTION_${PN}-dev = "${DESCRIPTION} B"
> +DESCRIPTION:${PN}-dev = "${DESCRIPTION} B"
>  PN = "bc"
>  """
>  
> @@ -136,9 +136,9 @@ PN = "bc"
>          f = self.parsehelper(self.overridetest3)
>          d = bb.parse.handle(f.name, self.d)['']
>          bb.data.expandKeys(d)
> -        self.assertEqual(d.getVar("DESCRIPTION_bc-dev"), "A B")
> +        self.assertEqual(d.getVar("DESCRIPTION:bc-dev"), "A B")
>          d.setVar("DESCRIPTION", "E")
> -        d.setVar("DESCRIPTION_bc-dev", "C D")
> +        d.setVar("DESCRIPTION:bc-dev", "C D")
>          d.setVar("OVERRIDES", "bc-dev")
>          self.assertEqual(d.getVar("DESCRIPTION"), "C D")
>  
> diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
> index 7f7e922ade..4c94b407d7 100644
> --- a/lib/toaster/orm/models.py
> +++ b/lib/toaster/orm/models.py
> @@ -1719,7 +1719,7 @@ class CustomImageRecipe(Recipe):
>          """Generate the contents for the recipe file."""
>          # If we have no excluded packages we only need to _append
>          if self.excludes_set.count() == 0:
> -            packages_conf = "IMAGE_INSTALL_append = \" "
> +            packages_conf = "IMAGE_INSTALL:append = \" "
>  
>              for pkg in self.appends_set.all():
>                  packages_conf += pkg.name+' '
> diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
> index 9a5e48e3bb..04ab8bcb04 100644
> --- a/lib/toaster/toastergui/views.py
> +++ b/lib/toaster/toastergui/views.py
> @@ -1708,7 +1708,7 @@ if True:
>              except ProjectVariable.DoesNotExist:
>                  pass
>              try:
> -                return_data['image_install_append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value,
> +                return_data['image_install:append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL:append").value,
>              except ProjectVariable.DoesNotExist:
>                  pass
>              try:
> @@ -1839,8 +1839,8 @@ if True:
>          except ProjectVariable.DoesNotExist:
>              pass
>          try:
> -            context['image_install_append'] =  ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value
> -            context['image_install_append_defined'] = "1"
> +            context['image_install:append'] =  ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL:append").value
> +            context['image_install:append_defined'] = "1"

I've never seen this one before but maybe:
s/image_install:append_defined/image_install:append:defined/ ?

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion
  2021-07-30 13:47 ` [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion Richard Purdie
@ 2021-07-30 14:11   ` Quentin Schulz
  2021-07-30 14:12     ` Richard Purdie
  2021-08-02 22:09   ` Quentin Schulz
  1 sibling, 1 reply; 13+ messages in thread
From: Quentin Schulz @ 2021-07-30 14:11 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

Hi Richard,

On Fri, Jul 30, 2021 at 02:47:05PM +0100, Richard Purdie wrote:
> The examples and tests use non-standard override names, convert these to
> the new syntax by hand.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
[...]
> diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
> index 02a5c4952a..1b6b6d412e 100644
> --- a/lib/bb/tests/parse.py
> +++ b/lib/bb/tests/parse.py
> @@ -144,7 +144,7 @@ PN = "bc"
>  
>  
>      classextend = """
> -VAR_var_override1 = "B"
> +VAR_var:override1 = "B"

s/VAR_var:override1/VAR:var:override1/ ?

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 2/4] doc/lib: Update to use new override syntax containing colons
  2021-07-30 14:08   ` [bitbake-devel] " Quentin Schulz
@ 2021-07-30 14:11     ` Richard Purdie
  2021-08-02  9:17       ` Quentin Schulz
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Purdie @ 2021-07-30 14:11 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: bitbake-devel

On Fri, 2021-07-30 at 16:08 +0200, Quentin Schulz wrote:
> Hi Richard,
> 
> On Fri, Jul 30, 2021 at 02:47:04PM +0100, Richard Purdie wrote:
> > This runs the overrides conversion script in OE-Core over the bitbake code
> > base including the docs. A handful of things were excluded in toaster
> > and for the Changelog file.
> > 
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > ---
> >  contrib/vim/plugin/newbbappend.vim            |  2 +-
> >  .../bitbake-user-manual-metadata.rst          | 64 +++++++++----------
> >  .../bitbake-user-manual-ref-variables.rst     | 14 ++--
> >  lib/bb/fetch2/__init__.py                     |  2 +-
> >  lib/bb/tests/data.py                          | 52 +++++++--------
> >  lib/bb/tests/parse.py                         | 16 ++---
> >  lib/toaster/orm/models.py                     |  2 +-
> >  lib/toaster/toastergui/views.py               |  6 +-
> >  .../management/commands/buildimport.py        |  2 +-
> >  9 files changed, 80 insertions(+), 80 deletions(-)
> > 
> > diff --git a/contrib/vim/plugin/newbbappend.vim b/contrib/vim/plugin/newbbappend.vim
> > index e04174cf62..3f65f79cdc 100644
> > --- a/contrib/vim/plugin/newbbappend.vim
> > +++ b/contrib/vim/plugin/newbbappend.vim
> > @@ -20,7 +20,7 @@ fun! NewBBAppendTemplate()
> >      set nopaste
> >  
> > 
> > 
> > 
> >      " New bbappend template
> > -    0 put ='FILESEXTRAPATHS_prepend := \"${THISDIR}/${PN}:\"'
> > +    0 put ='FILESEXTRAPATHS:prepend := \"${THISDIR}/${PN}:\"'
> >      2
> >  
> > 
> > 
> > 
> >      if paste == 1
> > diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > index 3e14163ebe..db44e26fbd 100644
> > --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > @@ -281,11 +281,11 @@ operators in that their effects are applied at variable expansion time
> >  rather than being immediately applied. Here are some examples::
> >  
> > 
> > 
> > 
> >     B = "bval"
> > -   B_append = " additional data"
> > +   B:append = " additional data"
> >     C = "cval"
> > -   C_prepend = "additional data "
> > +   C:prepend = "additional data "
> >     D = "dval"
> > -   D_append = "additional data"
> > +   D:append = "additional data"
> >  
> > 
> > 
> > 
> >  The variable :term:`B`
> >  becomes "bval additional data" and ``C`` becomes "additional data cval".
> > @@ -312,10 +312,10 @@ When you use this syntax, BitBake expects one or more strings.
> >  Surrounding spaces and spacing are preserved. Here is an example::
> >  
> > 
> > 
> > 
> >     FOO = "123 456 789 123456 123 456 123 456"
> > -   FOO_remove = "123"
> > -   FOO_remove = "456"
> > +   FOO:remove = "123"
> > +   FOO:remove = "456"
> >     FOO2 = " abc def ghi abcdef abc def abc def def"
> > -   FOO2_remove = "\
> > +   FOO2:remove = "\
> >         def \
> >         abc \
> >         ghi \
> > @@ -349,15 +349,15 @@ If, on the other hand, ``foo.bbclass``
> >  uses the "_append" operator, then the final value of ``FOO`` will be
> >  "initial val", as intended::
> >  
> > 
> > 
> > 
> > -   FOO_append = " val"
> > +   FOO:append = " val"
> >  
> > 
> > 
> > 
> >  .. note::
> >  
> > 
> > 
> > 
> >     It is never necessary to use "+=" together with "_append". The following
> >     sequence of assignments appends "barbaz" to FOO::
> >  
> > 
> > 
> > 
> > -       FOO_append = "bar"
> > -       FOO_append = "baz"
> > +       FOO:append = "bar"
> > +       FOO:append = "baz"
> >  
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> >     The only effect of changing the second assignment in the previous
> > @@ -538,12 +538,12 @@ variable.
> >     that value based on the architecture of the build::
> >  
> > 
> > 
> > 
> >        KBRANCH = "standard/base"
> > -      KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
> > -      KBRANCH_qemumips = "standard/mti-malta32"
> > -      KBRANCH_qemuppc = "standard/qemuppc"
> > -      KBRANCH_qemux86 = "standard/common-pc/base"
> > -      KBRANCH_qemux86-64 = "standard/common-pc-64/base"
> > -      KBRANCH_qemumips64 = "standard/mti-malta64"
> > +      KBRANCH:qemuarm = "standard/arm-versatile-926ejs"
> > +      KBRANCH:qemumips = "standard/mti-malta32"
> > +      KBRANCH:qemuppc = "standard/qemuppc"
> > +      KBRANCH:qemux86 = "standard/common-pc/base"
> > +      KBRANCH:qemux86-64 = "standard/common-pc-64/base"
> > +      KBRANCH:qemumips64 = "standard/mti-malta64"
> >  
> > 
> > 
> > 
> >  -  *Appending and Prepending:* BitBake also supports append and prepend
> >     operations to variable values based on whether a specific item is
> > @@ -551,7 +551,7 @@ variable.
> >  
> > 
> > 
> > 
> >        DEPENDS = "glibc ncurses"
> >        OVERRIDES = "machine:local"
> > -      DEPENDS_append_machine = "libmad"
> > +      DEPENDS:append_machine = "libmad"
> >  
> > 
> > 
> > 
> 
> s/DEPENDS:append_machine/DEPENDS:append:machine/


This patch was the automated conversion, there is a followup patch which
does fix most of these, I haven't checked them all. Could you have a look and see
if that does catch the other issues?

I left them as two separate patches since it makes it clear the things the script
does and does not fix.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion
  2021-07-30 14:11   ` [bitbake-devel] " Quentin Schulz
@ 2021-07-30 14:12     ` Richard Purdie
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Purdie @ 2021-07-30 14:12 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: bitbake-devel

On Fri, 2021-07-30 at 16:11 +0200, Quentin Schulz wrote:
> Hi Richard,
> 
> On Fri, Jul 30, 2021 at 02:47:05PM +0100, Richard Purdie wrote:
> > The examples and tests use non-standard override names, convert these to
> > the new syntax by hand.
> > 
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > ---
> [...]
> > diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
> > index 02a5c4952a..1b6b6d412e 100644
> > --- a/lib/bb/tests/parse.py
> > +++ b/lib/bb/tests/parse.py
> > @@ -144,7 +144,7 @@ PN = "bc"
> >  
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> >      classextend = """
> > -VAR_var_override1 = "B"
> > +VAR_var:override1 = "B"
> 
> s/VAR_var:override1/VAR:var:override1/ ?

I think not since in this test case, var is not an override?

Cheers,

Richard


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 1/4] bitbake: Switch to using new override syntax
  2021-07-30 13:47 [PATCH 1/4] bitbake: Switch to using new override syntax Richard Purdie
                   ` (2 preceding siblings ...)
  2021-07-30 13:47 ` [PATCH 4/4] bitbake: Update to version 1.51.1 Richard Purdie
@ 2021-07-30 14:24 ` Martin Jansa
  2021-07-30 14:36   ` Richard Purdie
  3 siblings, 1 reply; 13+ messages in thread
From: Martin Jansa @ 2021-07-30 14:24 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 3441 bytes --]

On Fri, Jul 30, 2021 at 3:47 PM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> This change updates the datastore to use the new override syntax using
> colons instead of underscores exclusively. It is expected layers would
> have to be converted to work with bitbake after this change.
>
> Supporting mixed syntax isn't possible, it is only feasible to have
> one internal representation of overrides.
>
> Whilst we can't warn for every possible override that may be set in the
> old format, show errors for _append/_prepend/_remove since those should
> never be present.
>

Thanks!

Already helped me to catch few cases which weren't converted automatically
with the script:

 ERROR: meta-webosose/meta-webos/recipes-webos/com.webos.app.notification/
com.webos.app.notification.bb: Variable
webos_configure_manifest_comment_remover contains an operation using the
old override syntax. Please convert this layer/metadata before attempting
to use with a newer bitbake.
ERROR: meta-webosose/meta-webos/recipes-webos/libpmscore/libpmscore.bb:
Variable do_generate_toolchain_file_append contains an operation using the
old override syntax. Please convert this layer/metadata before attempting
to use with a newer bitbake.
ERROR: meta-webosose/meta-webos/recipes-webos/media-resource-calculator/
media-resource-calculator.bb: Variable do_generate_toolchain_file_append
contains an operation using the old override syntax. Please convert this
layer/metadata before attempting to use with a newer bitbake.
ERROR: meta-webosose/meta-webos/recipes-webos/com.webos.app.videoplayer/
com.webos.app.videoplayer.bb: Variable
webos_configure_manifest_comment_remover contains an operation using the
old override syntax. Please convert this layer/metadata before attempting
to use with a newer bitbake.
ERROR: meta-webosose/meta-webos/recipes-webos/jemalloc/jemalloc.bb:
Variable do_generate_toolchain_file_append contains an operation using the
old override syntax. Please convert this layer/metadata before attempting
to use with a newer bitbake.
ERROR: oe-core/meta/recipes-kernel/linux/linux-yocto_5.4.bb: Variable
do_deploy_links_append contains an operation using the old override syntax.
Please convert this layer/metadata before attempting to use with a newer
bitbake.
ERROR: meta-webosose/meta-webos/recipes-webos/videooutputd/
com.webos.service.videooutput.bb: Variable
do_generate_toolchain_file_append contains an operation using the old
override syntax. Please convert this layer/metadata before attempting to
use with a newer bitbake.
ERROR: Failed to parse recipe:
meta-webosose/meta-webos/recipes-webos/com.webos.app.notification/
com.webos.app.notification.bb
ERROR: meta-webosose/meta-webos/recipes-webos/com.webos.service.tts/
com.webos.service.tts.bb: Variable do_generate_toolchain_file_append
contains an operation using the old override syntax. Please convert this
layer/metadata before attempting to use with a newer bitbake.

The webos_configure_manifest_comment_remover is a false positive, but I
don't mind renaming it to something else (if it can confuse he regexp, then
person could get confused as well).

And the other 2 are real issues:

$ git grep do_generate_toolchain_file_append
meta-webos/classes/webos_cmake.bbclass:do_generate_toolchain_file_append() {
meta-webos/recipes-webos/db8/db8.bb:cmake_do_generate_toolchain_file_append()
{

[-- Attachment #2: Type: text/html, Size: 4388 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 1/4] bitbake: Switch to using new override syntax
  2021-07-30 14:24 ` [bitbake-devel] [PATCH 1/4] bitbake: Switch to using new override syntax Martin Jansa
@ 2021-07-30 14:36   ` Richard Purdie
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Purdie @ 2021-07-30 14:36 UTC (permalink / raw)
  To: Martin Jansa; +Cc: bitbake-devel

On Fri, 2021-07-30 at 16:24 +0200, Martin Jansa wrote:
> The webos_configure_manifest_comment_remover is a false positive, but I don't mind renaming it to something
> else (if it can confuse he regexp, then person could get confused as well).

We could change that to do if "_append_" in var or var.endswith("_append")
which would remove the false positive. I guess it depends if we want
to encourage these kinds of names... :)

Cheers,

Richard




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 2/4] doc/lib: Update to use new override syntax containing colons
  2021-07-30 14:11     ` Richard Purdie
@ 2021-08-02  9:17       ` Quentin Schulz
  0 siblings, 0 replies; 13+ messages in thread
From: Quentin Schulz @ 2021-08-02  9:17 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

Hi Richard, Michael,

On Fri, Jul 30, 2021 at 03:11:21PM +0100, Richard Purdie wrote:
> On Fri, 2021-07-30 at 16:08 +0200, Quentin Schulz wrote:
> > Hi Richard,
> > 
> > On Fri, Jul 30, 2021 at 02:47:04PM +0100, Richard Purdie wrote:
[...]
> This patch was the automated conversion, there is a followup patch which
> does fix most of these, I haven't checked them all. Could you have a look and see
> if that does catch the other issues?
> 

I'll check this ASAP. Please give me a day or two before shouting :)
I can provide a fixup patch for the follow-up patch if that makes it
easier.

> I left them as two separate patches since it makes it clear the things the script
> does and does not fix.
> 

Makes it harder to review but I understand where you're going with this
:)

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion
  2021-07-30 13:47 ` [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion Richard Purdie
  2021-07-30 14:11   ` [bitbake-devel] " Quentin Schulz
@ 2021-08-02 22:09   ` Quentin Schulz
  2021-08-04  9:58     ` Richard Purdie
  1 sibling, 1 reply; 13+ messages in thread
From: Quentin Schulz @ 2021-08-02 22:09 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

Hi Richard,

On 2021-07-30 15:47, Richard Purdie wrote:
> The examples and tests use non-standard override names, convert these 
> to
> the new syntax by hand.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
[...]

I can suggest the following additional changes. Please note that there 
are two sections for which I have doubts about their correctness. They 
are preceded by a FIXME FIXME FIXME comment that can (should) easily be 
removable after applying this diff with `patch`.

diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst 
b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index 6b88fd11..b0494d08 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -325,14 +325,14 @@ Surrounding spaces and spacing are preserved. Here 
is an example::
  The variable ``FOO`` becomes
  "  789 123456    " and ``FOO2`` becomes "    abcdef     ".

-Like "_append" and "_prepend", "_remove" is applied at variable
+Like ":append" and ":prepend", ":remove" is applied at variable
  expansion time.

  Override Style Operation Advantages
  -----------------------------------

-An advantage of the override style operations "_append", "_prepend", 
and
-"_remove" as compared to the "+=" and "=+" operators is that the
+An advantage of the override style operations ":append", ":prepend", 
and
+":remove" as compared to the "+=" and "=+" operators is that the
  override style operators provide guaranteed operations. For example,
  consider a class ``foo.bbclass`` that needs to add the value "val" to
  the variable ``FOO``, and a recipe that uses ``foo.bbclass`` as 
follows::
@@ -347,14 +347,14 @@ not what is desired::
     FOO += "val"

  If, on the other hand, ``foo.bbclass``
-uses the "_append" operator, then the final value of ``FOO`` will be
+uses the ":append" operator, then the final value of ``FOO`` will be
  "initial val", as intended::

     FOO:append = " val"

  .. note::

-   It is never necessary to use "+=" together with "_append". The 
following
+   It is never necessary to use "+=" together with ":append". The 
following
     sequence of assignments appends "barbaz" to FOO::

         FOO:append = "bar"
@@ -379,8 +379,8 @@ You can find more out about variable flags in 
general in the
  You can define, append, and prepend values to variable flags. All the
  standard syntax operations previously mentioned work for variable flags
-except for override style syntax (i.e. "_prepend", "_append", and
-"_remove").
+except for override style syntax (i.e. ":prepend", ":append", and
+":remove").

  Here are some examples showing how to set variable flags::

@@ -581,7 +581,7 @@ variable.
     ``do_compile`` task.

     You can also use this syntax with other combinations (e.g.
-   "``_prepend``") as shown in the following example::
+   "``:prepend``") as shown in the following example::

        EXTRA_OEMAKE:prepend:task-compile = "${PARALLEL_MAKE} "

@@ -613,7 +613,7 @@ users.

  There is often confusion concerning the order in which overrides and
  various "append" operators take effect. Recall that an append or 
prepend
-operation using "_append" and "_prepend" does not result in an 
immediate
+operation using ":append" and ":prepend" does not result in an 
immediate
  assignment as would "+=", ".=", "=+", or "=.". Consider the following
  example::

@@ -671,7 +671,7 @@ For this case, the type of append
  operators are affecting the order of assignments as BitBake passes
  through the code multiple times. Initially, ``A`` is set to "1 45"
  because of the three statements that use immediate operators. After
-these assignments are made, BitBake applies the "_append" operations.
+these assignments are made, BitBake applies the ":append" operations.
  Those operations result in ``A`` becoming "1 4523".

  Sharing Functionality
@@ -908,7 +908,7 @@ rules. The scripts are executed by ``/bin/sh``, 
which may not be a bash
  shell but might be something such as ``dash``. You should not use
  Bash-specific script (bashisms).
-Overrides and override-style operators like ``_append`` and 
``_prepend``
+Overrides and override-style operators like ``:append`` and 
``:prepend``
  can also be applied to shell functions. Most commonly, this application
  would be used in a ``.bbappend`` file to modify functions in the main
  recipe. It can also be used to modify functions inherited from classes.
@@ -1135,7 +1135,7 @@ equivalent to the following snippet::
  values set for the variables within the anonymous functions become
  available to tasks, which always run after parsing.

-Overrides and override-style operators such as "``_append``" are 
applied
+Overrides and override-style operators such as "``:append``" are 
applied
  before anonymous functions run. In the following example, ``FOO`` ends
  up with the value "foo from anonymous"::

@@ -1165,7 +1165,7 @@ To understand the benefits of this feature, 
consider the basic scenario
  where a class defines a task function and your recipe inherits the
  class. In this basic scenario, your recipe inherits the task function 
as
  defined in the class. If desired, your recipe can add to the start and
-end of the function by using the "_prepend" or "_append" operations
+end of the function by using the ":prepend" or ":append" operations
  respectively, or it can redefine the function completely. However, if 
it
  redefines the function, there is no means for it to call the class
  version of the function. ``EXPORT_FUNCTIONS`` provides a mechanism that
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 60aaf390..46ce78a6 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1146,9 +1146,10 @@ def srcrev_internal_helper(ud, d, name):
      pn = d.getVar("PN")
      attempts = []
      if name != '' and pn:
-        attempts.append("SRCREV_%s_pn-%s" % (name, pn))
+        #FIXME FIXME FIXME not sure about the SRCREV_%s to SRCREV:%s 
change
+        attempts.append("SRCREV:%s:pn-%s" % (name, pn))
      if name != '':
-        attempts.append("SRCREV_%s" % name)
+        attempts.append("SRCREV:%s" % name)
      if pn:
          attempts.append("SRCREV:pn-%s" % pn)
      attempts.append("SRCREV")
diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
index 1b6b6d41..4d17f82e 100644
--- a/lib/bb/tests/parse.py
+++ b/lib/bb/tests/parse.py
@@ -99,7 +99,7 @@ exportD = "d"

      overridetest = """
  RRECOMMENDS:${PN} = "a"
-RRECOMMENDS:${PN}_libc = "b"
+RRECOMMENDS:${PN}:libc = "b"
  OVERRIDES = "libc:${PN}"
  PN = "gtk+"
  """
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 6ba1d2a3..e6e82d11 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -1178,7 +1178,7 @@ def edit_metadata(meta_lines, variables, varfunc, 
match_overrides=False):
          variables: a list of variable names to look for. Functions
              may also be specified, but must be specified with '()' at
              the end of the name. Note that the function doesn't have
-            any intrinsic understanding of _append, _prepend, _remove,
+            any intrinsic understanding of :append, :prepend, :remove,
              or overrides, so these are considered as part of the name.
              These values go into a regular expression, so regular
              expression syntax is allowed.
diff --git a/lib/toaster/toastergui/views.py 
b/lib/toaster/toastergui/views.py
index 04ab8bcb..34afacc1 100644
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -1839,6 +1839,7 @@ if True:
          except ProjectVariable.DoesNotExist:
              pass
          try:
+            #FIXME FIXME FIXME Is this correct? it could also be 
image_install_append_defined or image_install:append:defined
              context['image_install:append'] =  
ProjectVariable.objects.get(project = prj, name = 
"IMAGE_INSTALL:append").value
              context['image_install:append_defined'] = "1"
          except ProjectVariable.DoesNotExist:

--------
Cheers,
Quentin

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [bitbake-devel] [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion
  2021-08-02 22:09   ` Quentin Schulz
@ 2021-08-04  9:58     ` Richard Purdie
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Purdie @ 2021-08-04  9:58 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: bitbake-devel

On Tue, 2021-08-03 at 00:09 +0200, Quentin Schulz wrote:
> I can suggest the following additional changes. Please note that there 
> are two sections for which I have doubts about their correctness. They 
> are preceded by a FIXME FIXME FIXME comment that can (should) easily be 
> removable after applying this diff with `patch`.

Thanks. I couldn't get the patch to apply for some reason (line wrapping?)
so I just fixed up the references.

> diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
> index 60aaf390..46ce78a6 100644
> --- a/lib/bb/fetch2/__init__.py
> +++ b/lib/bb/fetch2/__init__.py
> @@ -1146,9 +1146,10 @@ def srcrev_internal_helper(ud, d, name):
>       pn = d.getVar("PN")
>       attempts = []
>       if name != '' and pn:
> -        attempts.append("SRCREV_%s_pn-%s" % (name, pn))
> +        #FIXME FIXME FIXME not sure about the SRCREV_%s to SRCREV:%s change
> +        attempts.append("SRCREV:%s:pn-%s" % (name, pn))
>       if name != '':
> -        attempts.append("SRCREV_%s" % name)
> +        attempts.append("SRCREV:%s" % name)

This one shouldn't be changed, at least not at this point as name is never
an override.

> diff --git a/lib/toaster/toastergui/views.py 
> b/lib/toaster/toastergui/views.py
> index 04ab8bcb..34afacc1 100644
> --- a/lib/toaster/toastergui/views.py
> +++ b/lib/toaster/toastergui/views.py
> @@ -1839,6 +1839,7 @@ if True:
>           except ProjectVariable.DoesNotExist:
>               pass
>           try:
> +            #FIXME FIXME FIXME Is this correct? it could also be 
> image_install_append_defined or image_install:append:defined
>               context['image_install:append'] =  
> ProjectVariable.objects.get(project = prj, name = 
> "IMAGE_INSTALL:append").value
>               context['image_install:append_defined'] = "1"
>           except ProjectVariable.DoesNotExist:

Kicking myself on this one as I meant to fix it and something must have got 
lost in the process. It should stay as image_install_append_defined

I've sent out a couple of patches with the updated version of this, 
thanks again.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-08-04  9:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 13:47 [PATCH 1/4] bitbake: Switch to using new override syntax Richard Purdie
2021-07-30 13:47 ` [PATCH 2/4] doc/lib: Update to use new override syntax containing colons Richard Purdie
2021-07-30 14:08   ` [bitbake-devel] " Quentin Schulz
2021-07-30 14:11     ` Richard Purdie
2021-08-02  9:17       ` Quentin Schulz
2021-07-30 13:47 ` [PATCH 3/4] doc/lib: Add fixes for issues missed by the automated conversion Richard Purdie
2021-07-30 14:11   ` [bitbake-devel] " Quentin Schulz
2021-07-30 14:12     ` Richard Purdie
2021-08-02 22:09   ` Quentin Schulz
2021-08-04  9:58     ` Richard Purdie
2021-07-30 13:47 ` [PATCH 4/4] bitbake: Update to version 1.51.1 Richard Purdie
2021-07-30 14:24 ` [bitbake-devel] [PATCH 1/4] bitbake: Switch to using new override syntax Martin Jansa
2021-07-30 14:36   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.