Skip to contentSkip to conversation

parse/BBHandler: Avoid repeatedly resetting FILE

PATCH New Richard Purdie 1 participant 1 message Jun 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parse/BBHandler: Avoid repeatedly resetting FILE

If we're not going to change the value of FILE, or we know it isn't going to have changed (ext == bbclass), don't set FILE.

This avoids messy looking history of the variable as well as optimises parsing speed slightly.

bitbake/lib/bb/parse/parse_py/BBHandler.py +2 -2
index 85c27c2..03109df 100644
@@ -148,7 +148,7 @@ def handle(fn, d, include):
     statements = get_statements(fn, abs_fn, base_name)
 
     # DONE WITH PARSING... time to evaluate
-    if ext != ".bbclass":
+    if ext != ".bbclass" and abs_fn != oldfile:
         d.setVar('FILE', abs_fn)
 
     try:
@@ -166,7 +166,7 @@ def handle(fn, d, include):
     if ext != ".bbclass" and include == 0:
         return ast.multi_finalize(fn, d)
 
-    if oldfile:
+    if ext != ".bbclass" and oldfile and abs_fn != oldfile:
         d.setVar("FILE", oldfile)
 
     return d