summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKristian Amlie <kristian.amlie@northern.tech>2022-09-08 14:16:06 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-16 17:53:23 +0100
commit5ae57d4c9b1faa744d0a9bef0f2310d48d0bf0f1 (patch)
treeef9476cb669f183d63ae0a2b841e0d2e1a9bf6a6 /meta
parent26dbc1f641a432a6a7f497a3d31ccee933bbb85c (diff)
downloadpoky-5ae57d4c9b1faa744d0a9bef0f2310d48d0bf0f1.tar.gz
externalsrc: Don't wipe out src dir when EXPORT_FUNCTIONS is used.
When 73fa855f6af5ef9c3 was introduced, the "cleandirs" variable flag started applying to functions exported using EXPORT_FUNCTIONS. The externalsrc class is supposed to remove cleandirs in order to prevent wiping out an external src folder (home directory?), but doesn't take the previous point into account. The result is that cleandirs is still in effect. To fix this, apply the cleandirs manipulation to all variables, not just predefined ones. This is expensive, but since it executes inside an `if externalsrc` clause, and EXTERNALSRC is usually only set for specific single recipes, it won't affect most recipes. Richard Purdie <richard.purdie@linuxfoundation.org> is the original author of this patch. I just submitted it under my name for blame purposes, and also we have been testing it a lot in my company. This is the original discussion: https://lists.openembedded.org/g/openembedded-core/topic/91374926 (From OE-Core rev: 70f7575bfe7e3b136125b1db7ad5549074e7fd1c) Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 74ad497a55007960a4869905878e3ccbd11e4369) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/externalsrc.bbclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 90792a737b..8136d25cb1 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -90,16 +90,18 @@ python () {
90 # Since configure will likely touch ${S}, ensure only we lock so one task has access at a time 90 # Since configure will likely touch ${S}, ensure only we lock so one task has access at a time
91 d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock") 91 d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock")
92 92
93 for funcname in [task, "base_" + task, "kernel_" + task]: 93 for v in d.keys():
94 cleandirs = d.getVarFlag(v, "cleandirs", False)
95 if cleandirs:
94 # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean) 96 # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean)
95 cleandirs = oe.recipeutils.split_var_value(d.getVarFlag(funcname, 'cleandirs', False) or '') 97 cleandirs = oe.recipeutils.split_var_value(cleandirs)
96 setvalue = False 98 setvalue = False
97 for cleandir in cleandirs[:]: 99 for cleandir in cleandirs[:]:
98 if oe.path.is_path_parent(externalsrc, d.expand(cleandir)): 100 if oe.path.is_path_parent(externalsrc, d.expand(cleandir)):
99 cleandirs.remove(cleandir) 101 cleandirs.remove(cleandir)
100 setvalue = True 102 setvalue = True
101 if setvalue: 103 if setvalue:
102 d.setVarFlag(funcname, 'cleandirs', ' '.join(cleandirs)) 104 d.setVarFlag(v, 'cleandirs', ' '.join(cleandirs))
103 105
104 fetch_tasks = ['do_fetch', 'do_unpack'] 106 fetch_tasks = ['do_fetch', 'do_unpack']
105 # If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one 107 # If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one