[kirkstone,33/34] staging: Ensure we filter out ourselves

Message ID a1eba0f2d36f3bb03323a65c66dd2a83c5dd2c05.1651246310.git.steve@sakoman.com
State Accepted, archived
Commit a1eba0f2d36f3bb03323a65c66dd2a83c5dd2c05
Headers show
Series [kirkstone,01/34] e2fsprogs: fix CVE-2022-1304 | expand

Commit Message

Steve Sakoman April 29, 2022, 4 p.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

Adding a dependency on ourselves in this function doesn't make sense, the hash
may change after hash equivalence is applied. Other code using BB_TASKDEPDATA does
handle the self reference correctly (which is there for a reason), update this
code to do likewise.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d98b06c9c6f480de1e5167bfe8392e39300fc02c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/staging.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index ab827766be..9fc8f4f283 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -651,7 +651,7 @@  python target_add_sysroot_deps () {
     taskdepdata = d.getVar("BB_TASKDEPDATA", False)
     deps = {}
     for dep in taskdepdata.values():
-        if dep[1] == "do_populate_sysroot" and not dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0]:
+        if dep[1] == "do_populate_sysroot" and not dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0] and dep[0] != pn:
             deps[dep[0]] = dep[6]
 
     d.setVar("HASHEQUIV_EXTRA_SIGDATA", "\n".join("%s: %s" % (k, deps[k]) for k in sorted(deps.keys())))