summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-02-19 16:39:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-23 17:35:28 +0000
commitdb7f7b5097821c60729904e0f5011ab550669a47 (patch)
tree03d4ce9623a532fef5942a84c9869c6f04891da2 /meta/classes
parentf205ccaf48ac36f4b26efc4aeb2e9d2939b28646 (diff)
downloadpoky-db7f7b5097821c60729904e0f5011ab550669a47.tar.gz
classes/externalsrc: fix source being wiped out on clean with kernel
kernel.bbclass adds ${S} do do_clean[cleandirs], but this means if you run bitbake -c clean <kernelrecipe> then your external source tree will be trashed, which could be a disaster. For safety, remove ${S} from cleandirs for every task. We also have to do the same for ${B} in the case where EXTERNALSRC_BUILD is set to the same value as EXTERNALSRC. (From OE-Core rev: b5071fb2667b8751885d38ca62fa36c870177cd5) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/externalsrc.bbclass14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 4e429d78d8..e372392801 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -47,6 +47,20 @@ python () {
47 # Since configure will likely touch ${S}, ensure only we lock so one task has access at a time 47 # Since configure will likely touch ${S}, ensure only we lock so one task has access at a time
48 d.appendVarFlag(task, "lockfiles", "${S}/singletask.lock") 48 d.appendVarFlag(task, "lockfiles", "${S}/singletask.lock")
49 49
50 # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean)
51 cleandirs = d.getVarFlag(task, 'cleandirs', False)
52 if cleandirs:
53 cleandirs = cleandirs.split()
54 setvalue = False
55 if '${S}' in cleandirs:
56 cleandirs.remove('${S}')
57 setvalue = True
58 if externalsrcbuild == externalsrc and '${B}' in cleandirs:
59 cleandirs.remove('${B}')
60 setvalue = True
61 if setvalue:
62 d.setVarFlag(task, 'cleandirs', ' '.join(cleandirs))
63
50 for task in d.getVar("SRCTREECOVEREDTASKS", True).split(): 64 for task in d.getVar("SRCTREECOVEREDTASKS", True).split():
51 bb.build.deltask(task, d) 65 bb.build.deltask(task, d)
52 66