summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-09-08 13:36:40 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-12 22:48:31 +0100
commit9a24b6b1237c8fd0b413099b2a7ea82262973cac (patch)
tree79ea49e182560e1093513db2dde4e534fcb3522f /meta/classes
parentf0af24eedff0a9f689283e24767fbff4f7cc8ed7 (diff)
downloadpoky-9a24b6b1237c8fd0b413099b2a7ea82262973cac.tar.gz
externalsrc.bbclass: better filtering of cleandirs
We really do not want our (external) source tree to be removed. There might be multiple values in the 'cleandirs' varflag pointing to our source tree - causing it to be wiped out. This patch improves the filtering of 'cleandirs' by examining the expanded values inside it. Any (expanded) values pointing to our source tree get removed. (From OE-Core rev: eec871fe405e140a1919999fe2f4cf24f1839e5d) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/externalsrc.bbclass18
1 files changed, 7 insertions, 11 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 37c6320fca..0fa5817d9a 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -62,18 +62,14 @@ python () {
62 d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock") 62 d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock")
63 63
64 # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean) 64 # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean)
65 cleandirs = d.getVarFlag(task, 'cleandirs', False) 65 cleandirs = (d.getVarFlag(task, 'cleandirs', False) or '').split()
66 if cleandirs: 66 setvalue = False
67 cleandirs = cleandirs.split() 67 for cleandir in cleandirs[:]:
68 setvalue = False 68 if d.expand(cleandir) == externalsrc:
69 if '${S}' in cleandirs: 69 cleandirs.remove(cleandir)
70 cleandirs.remove('${S}')
71 setvalue = True 70 setvalue = True
72 if externalsrcbuild == externalsrc and '${B}' in cleandirs: 71 if setvalue:
73 cleandirs.remove('${B}') 72 d.setVarFlag(task, 'cleandirs', ' '.join(cleandirs))
74 setvalue = True
75 if setvalue:
76 d.setVarFlag(task, 'cleandirs', ' '.join(cleandirs))
77 73
78 fetch_tasks = ['do_fetch', 'do_unpack'] 74 fetch_tasks = ['do_fetch', 'do_unpack']
79 # If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one 75 # If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one