]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
insane: Don't used cachedpath for os.lstat()
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Oct 2024 10:05:59 +0000 (11:05 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Oct 2024 20:41:57 +0000 (21:41 +0100)
The functions behave slightly differently to the functions they're
caching and the use in insane.bbclass isn't compatible. For now, to
avoid build failures, switch back to the stat calls. We may be able
to improve cachedpath or change the call sites.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/insane.bbclass
meta/lib/oe/cachedpath.py

index 36b139a20d076e541913a85c7791d4a4d65b9d8e..efcfa08d2e1e662b7654b4477ec784089d7b52ab 100644 (file)
@@ -434,9 +434,8 @@ def package_qa_check_buildpaths(path, name, d, elf):
     explicitly ignored.
     """
     import stat
-    global cpath
     # Ignore symlinks/devs/fifos
-    mode = cpath.lstat(path).st_mode
+    mode = os.lstat(path).st_mode
     if stat.S_ISLNK(mode) or stat.S_ISBLK(mode) or stat.S_ISFIFO(mode) or stat.S_ISCHR(mode) or stat.S_ISSOCK(mode):
         return
 
@@ -1050,7 +1049,7 @@ def package_qa_check_host_user(path, name, d, elf):
         return
 
     try:
-        stat = cpath.lstat(path)
+        stat = os.lstat(path)
     except OSError as exc:
         import errno
         if exc.errno != errno.ENOENT:
index 0138b791d4b021f02347142bdf527f2b090b19f2..68c85807d9f441bd5af985ab621f00c57c974032 100644 (file)
@@ -111,9 +111,13 @@ class CachedPath(object):
             return True
         return False
 
+    # WARNING - this is not currently a drop in replacement since they return False
+    # rather than raise exceptions.
     def stat(self, path):
         return self.callstat(path)
 
+    # WARNING - this is not currently a drop in replacement since they return False
+    # rather than raise exceptions.
     def lstat(self, path):
         return self.calllstat(path)