Skip to contentSkip to conversation

recipe_sanity: Drop rename overwrite detection

PATCH In review Anuj Mittal 2 participants 2 messages Nov 10

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 recipe_sanity: Drop rename overwrite detection

From: Richard Purdie <[email protected]>

Bitbake itself checks for probelmatic renames now during key expansion so this check shouldn't be needed anymore (it dates from pre 2011).

(https://git.openembedded.org/bitbake/tree/lib/bb/data.py#n96 in expandKeys())

(cherry picked from commit 7944665886cb0bf881807a5d849ebdf42a33d1bf)

The corresponding bitbake change was merged in 2.18: 4986a548e (data: Fix expandKeys recursion issue). Include this in wrynose as well so layers using this class continue to work.

---
 meta/classes/recipe_sanity.bbclass | 21 ---------------------
 1 file changed, 21 deletions(-)
meta/classes/recipe_sanity.bbclass +0 -21
index a5cc4315fb..3c763de1f2 100644
@@ -34,13 +34,6 @@ def req_vars(cfgdata, d):
         elif val == cfgval:
             __note("%s should be defined to something other than default (%s)" % (var, cfgval), d)
 
-def var_renames_overwrite(cfgdata, d):
-    renames = d.getVar("__recipe_sanity_renames", False)
-    if renames:
-        for (key, newkey, oldvalue, newvalue) in renames:
-            if oldvalue != newvalue and oldvalue != cfgdata.get(newkey):
-                __note("rename of variable '%s' to '%s' overwrote existing value '%s' with '%s'." % (key, newkey, oldvalue, newvalue), d)
-
 def incorrect_nonempty_PACKAGES(cfgdata, d):
     if bb.data.inherits_class("native", d) or \
             bb.data.inherits_class("cross", d):
@@ -113,7 +106,6 @@ python do_recipe_sanity () {
             __note(msg, d)
 
     can_delete_others(p, cfgdata, d)
-    var_renames_overwrite(cfgdata, d)
     req_vars(cfgdata, d)
     bad_runtime_vars(cfgdata, d)
 }
@@ -137,19 +129,6 @@ python recipe_sanity_eh () {
 
     d.setVar("__recipe_sanity_cfgdata", cfgdata)
     #d.setVar("__recipe_sanity_cfgdata", d)
-
-    # Sick, very sick..
-    from bb.data_smart import DataSmart
-    old = DataSmart.renameVar
-    def myrename(self, key, newkey):
-        oldvalue = self.getVar(newkey, 0)
-        old(self, key, newkey)
-        newvalue = self.getVar(newkey, 0)
-        if oldvalue:
-            renames = self.getVar("__recipe_sanity_renames", 0) or set()
-            renames.add((key, newkey, oldvalue, newvalue))
-            self.setVar("__recipe_sanity_renames", renames)
-    DataSmart.renameVar = myrename
 }
 addhandler recipe_sanity_eh
 recipe_sanity_eh[eventmask] = "bb.event.ConfigParsed"
Signature · 1 line
2.55.0
#1 lore raw
Quoted 10 lines · Anuj Mittal

From: Richard Purdie <[email protected]>

Bitbake itself checks for probelmatic renames now during key expansion so this check shouldn't be needed anymore (it dates from pre 2011).

(https://git.openembedded.org/bitbake/tree/lib/bb/data.py#n96 in expandKeys())

(cherry picked from commit 7944665886cb0bf881807a5d849ebdf42a33d1bf)
Quoted 8 lines

The corresponding bitbake change was merged in 2.18: 4986a548e (data: Fix expandKeys recursion issue). Include this in wrynose as well so layers using this class continue to work.

---
 meta/classes/recipe_sanity.bbclass | 21 ---------------------
 1 file changed, 21 deletions(-)

Thanks for the quick v2 :)

I'll add it to my review branch for this cycle.

Regards,

Signature · 2 lines
Yoann Congal
Smile ECS