summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-14 11:05:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-14 21:42:17 +0100
commit6dfe291284c6667e44733e06f820bf9546d4702b (patch)
treedb13412e07cfa58ae36fa2f21847137ca5c8d511
parentd2b2675cc40f55e4a8b27ea921bc4bb98fc2431d (diff)
downloadpoky-6dfe291284c6667e44733e06f820bf9546d4702b.tar.gz
insane: Don't used cachedpath for os.lstat()
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. (From OE-Core rev: fa771ae887ab5152f043748cf3419735831bcf7b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-global/insane.bbclass5
-rw-r--r--meta/lib/oe/cachedpath.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index 36b139a20d..efcfa08d2e 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -434,9 +434,8 @@ def package_qa_check_buildpaths(path, name, d, elf):
434 explicitly ignored. 434 explicitly ignored.
435 """ 435 """
436 import stat 436 import stat
437 global cpath
438 # Ignore symlinks/devs/fifos 437 # Ignore symlinks/devs/fifos
439 mode = cpath.lstat(path).st_mode 438 mode = os.lstat(path).st_mode
440 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): 439 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):
441 return 440 return
442 441
@@ -1050,7 +1049,7 @@ def package_qa_check_host_user(path, name, d, elf):
1050 return 1049 return
1051 1050
1052 try: 1051 try:
1053 stat = cpath.lstat(path) 1052 stat = os.lstat(path)
1054 except OSError as exc: 1053 except OSError as exc:
1055 import errno 1054 import errno
1056 if exc.errno != errno.ENOENT: 1055 if exc.errno != errno.ENOENT:
diff --git a/meta/lib/oe/cachedpath.py b/meta/lib/oe/cachedpath.py
index 0138b791d4..68c85807d9 100644
--- a/meta/lib/oe/cachedpath.py
+++ b/meta/lib/oe/cachedpath.py
@@ -111,9 +111,13 @@ class CachedPath(object):
111 return True 111 return True
112 return False 112 return False
113 113
114 # WARNING - this is not currently a drop in replacement since they return False
115 # rather than raise exceptions.
114 def stat(self, path): 116 def stat(self, path):
115 return self.callstat(path) 117 return self.callstat(path)
116 118
119 # WARNING - this is not currently a drop in replacement since they return False
120 # rather than raise exceptions.
117 def lstat(self, path): 121 def lstat(self, path):
118 return self.calllstat(path) 122 return self.calllstat(path)
119 123