diff options
author | Mark Hatle <mark.hatle@amd.com> | 2024-09-17 15:03:10 -0500 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-09-25 05:07:47 -0700 |
commit | 40eac6fe629d2f5c7256da90896d717770952a1f (patch) | |
tree | 8ed75693f6d34f2094668b3f4e2a0b17e31e35b8 | |
parent | cd4eeb1fb69a27e67e699aa6c7ffd8f9866243e3 (diff) | |
download | poky-40eac6fe629d2f5c7256da90896d717770952a1f.tar.gz |
create-sdpx-2.2.bbclass: Switch from exists to isfile checking debugsrc
While debugsrc is almost always a file (or link), there are apparently
cases where a directory could be returned from the dwarfsrcfiles
processing. When this happens, the hashing fails and an error results
when building the SPDX documents.
(From OE-Core rev: cc24c32795e6894387a6e7ebc9b1d9f4215621f0)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 02e262c291c0b2066132b4cb2ca5fda8145284a9)
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/classes/create-spdx-2.2.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index d104668ffd..ade1a04be3 100644 --- a/meta/classes/create-spdx-2.2.bbclass +++ b/meta/classes/create-spdx-2.2.bbclass | |||
@@ -315,7 +315,8 @@ def add_package_sources_from_debug(d, package_doc, spdx_package, package, packag | |||
315 | debugsrc_path = search / debugsrc.replace('/usr/src/kernel/', '') | 315 | debugsrc_path = search / debugsrc.replace('/usr/src/kernel/', '') |
316 | else: | 316 | else: |
317 | debugsrc_path = search / debugsrc.lstrip("/") | 317 | debugsrc_path = search / debugsrc.lstrip("/") |
318 | if not debugsrc_path.exists(): | 318 | # We can only hash files below, skip directories, links, etc. |
319 | if not os.path.isfile(debugsrc_path): | ||
319 | continue | 320 | continue |
320 | 321 | ||
321 | file_sha256 = bb.utils.sha256_file(debugsrc_path) | 322 | file_sha256 = bb.utils.sha256_file(debugsrc_path) |