diff mbox series

[RFC,4/3,v2] data_smart: remove old override syntax check

Message ID GV1PR07MB912042E2A43F852836D065DBA8682@GV1PR07MB9120.eurprd07.prod.outlook.com
State New
Headers show
Series None | expand

Commit Message

Konrad Weihmann Sept. 24, 2024, 9:09 a.m. UTC
after the override syntax change is now out in the field for
a longer time, the expensive check for the old syntax can be
removed.

This will save time while parsing, and should be side effect free,
as variables in the old syntax are simply rendered into
unapplicable variables.

A more complete check (e.g. RDEPENDS_${PN} checks) could be implemented elsewhere. as part of a sanity check

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
---
 lib/bb/data_smart.py  |  9 ---------
 lib/bb/tests/parse.py | 35 -----------------------------------
 2 files changed, 44 deletions(-)

Comments

Alexandre Belloni Sept. 25, 2024, 7:57 p.m. UTC | #1
Please send properly versioned and complete series, don't expect
maintainers to do your work and collected patches send a random times
with random versions.

On 24/09/2024 09:09:08+0000, Konrad Weihmann wrote:
> after the override syntax change is now out in the field for
> a longer time, the expensive check for the old syntax can be
> removed.
> 
> This will save time while parsing, and should be side effect free,
> as variables in the old syntax are simply rendered into
> unapplicable variables.
> 
> A more complete check (e.g. RDEPENDS_${PN} checks) could be implemented elsewhere. as part of a sanity check
> 
> Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
> ---
>  lib/bb/data_smart.py  |  9 ---------
>  lib/bb/tests/parse.py | 35 -----------------------------------
>  2 files changed, 44 deletions(-)
> 
> diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
> index 0523744de..fe4c50740 100644
> --- a/lib/bb/data_smart.py
> +++ b/lib/bb/data_smart.py
> @@ -539,15 +539,6 @@ class DataSmart(MutableMapping):
>          return var in self.overridedata
>  
>      def setVar(self, var, value, **loginfo):
> -        if not var.startswith("__anon_") and ("_append" in var or "_prepend" in var or "_remove" in var):
> -            if re.search(r"(_append|_prepend|_remove)(_|$)", var) is not None:
> -                info = "%s" % var
> -                if "file" in loginfo:
> -                    info += " file: %s" % loginfo["file"]
> -                if "line" in loginfo:
> -                    info += " line: %s" % loginfo["line"]
> -                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)
> -
>          shortvar = var.split(":", 1)[0]
>          if shortvar in self._var_renames:
>              _print_rename_error(shortvar, loginfo, self._var_renames, fullvar=var)
> diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
> index 2da3a2a22..6832952f8 100644
> --- a/lib/bb/tests/parse.py
> +++ b/lib/bb/tests/parse.py
> @@ -132,41 +132,6 @@ DESCRIPTION:${PN}-dev = "${DESCRIPTION} B"
>  PN = "bc"
>  """
>  
> -    override_old_append = """
> -EXTRA_OECONF_append = " c"
> -"""
> -
> -    def test_parse_old_override_syntax_append(self):
> -        f = self.parsehelper(self.override_old_append)
> -        try:
> -            bb.parse.handle(f.name, self.d)['']
> -            self.fail('Pattern should have raised bb.BBHandledException')
> -        except bb.BBHandledException:
> -            pass
> -
> -    override_old_prepend = """
> -EXTRA_OECONF_prepend = " c"
> -"""
> -
> -    def test_parse_old_override_syntax_prepend(self):
> -        f = self.parsehelper(self.override_old_prepend)
> -        try:
> -            bb.parse.handle(f.name, self.d)['']
> -            self.fail('Pattern should have raised bb.BBHandledException')
> -        except bb.BBHandledException:
> -            pass
> -
> -    override_old_remove = """
> -EXTRA_OECONF_remove = " c"
> -"""
> -
> -    def test_parse_old_override_syntax_remove(self):
> -        f = self.parsehelper(self.override_old_remove)
> -        try:
> -            bb.parse.handle(f.name, self.d)['']
> -            self.fail('Pattern should have raised bb.BBHandledException')
> -        except bb.BBHandledException:
> -            pass
>  
>      override_old_valid_append = """
>  do_appendsomething () {
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#16598): https://lists.openembedded.org/g/bitbake-devel/message/16598
> Mute This Topic: https://lists.openembedded.org/mt/108625078/3617179
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 0523744de..fe4c50740 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -539,15 +539,6 @@  class DataSmart(MutableMapping):
         return var in self.overridedata
 
     def setVar(self, var, value, **loginfo):
-        if not var.startswith("__anon_") and ("_append" in var or "_prepend" in var or "_remove" in var):
-            if re.search(r"(_append|_prepend|_remove)(_|$)", var) is not None:
-                info = "%s" % var
-                if "file" in loginfo:
-                    info += " file: %s" % loginfo["file"]
-                if "line" in loginfo:
-                    info += " line: %s" % loginfo["line"]
-                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)
-
         shortvar = var.split(":", 1)[0]
         if shortvar in self._var_renames:
             _print_rename_error(shortvar, loginfo, self._var_renames, fullvar=var)
diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
index 2da3a2a22..6832952f8 100644
--- a/lib/bb/tests/parse.py
+++ b/lib/bb/tests/parse.py
@@ -132,41 +132,6 @@  DESCRIPTION:${PN}-dev = "${DESCRIPTION} B"
 PN = "bc"
 """
 
-    override_old_append = """
-EXTRA_OECONF_append = " c"
-"""
-
-    def test_parse_old_override_syntax_append(self):
-        f = self.parsehelper(self.override_old_append)
-        try:
-            bb.parse.handle(f.name, self.d)['']
-            self.fail('Pattern should have raised bb.BBHandledException')
-        except bb.BBHandledException:
-            pass
-
-    override_old_prepend = """
-EXTRA_OECONF_prepend = " c"
-"""
-
-    def test_parse_old_override_syntax_prepend(self):
-        f = self.parsehelper(self.override_old_prepend)
-        try:
-            bb.parse.handle(f.name, self.d)['']
-            self.fail('Pattern should have raised bb.BBHandledException')
-        except bb.BBHandledException:
-            pass
-
-    override_old_remove = """
-EXTRA_OECONF_remove = " c"
-"""
-
-    def test_parse_old_override_syntax_remove(self):
-        f = self.parsehelper(self.override_old_remove)
-        try:
-            bb.parse.handle(f.name, self.d)['']
-            self.fail('Pattern should have raised bb.BBHandledException')
-        except bb.BBHandledException:
-            pass
 
     override_old_valid_append = """
 do_appendsomething () {