]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
classes/insane: create one CachedPath instance in qa_check_staged
authorRoss Burton <ross.burton@arm.com>
Fri, 3 Jul 2026 10:07:08 +0000 (11:07 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 6 Jul 2026 16:45:31 +0000 (17:45 +0100)
There's no need to create a new CachedPath instance for every file that
we want to scan, just create one at the beginning of the function.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/insane.bbclass

index a788817c89dcc405e21b0e8fcee4ce844f138c54..942b6e500d5e76a3a26b2f044904c6c028ba1450 100644 (file)
@@ -732,6 +732,10 @@ def qa_check_staged(path,d):
     workdir = os.path.join(tmpdir, "work")
     recipesysroot = d.getVar("RECIPE_SYSROOT")
 
+    # package_qa_check_shebang_size needs the global cpath to be already created
+    global cpath
+    cpath = oe.cachedpath.CachedPath()
+
     if bb.data.inherits_class("native", d) or bb.data.inherits_class("cross", d):
         pkgconfigcheck = workdir
     else:
@@ -775,10 +779,7 @@ def qa_check_staged(path,d):
                         oe.qa.handle_error("pkgconfig", error_msg, d)
 
             if not skip_shebang_size:
-                global cpath
-                cpath = oe.cachedpath.CachedPath()
                 package_qa_check_shebang_size(path, "", d, None)
-                cpath = None
 
 # Walk over all files in a directory and call func
 def package_qa_walk(checkfuncs, package, d):