summaryrefslogtreecommitdiff
path: root/meta/classes/externalsrc.bbclass
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:47:06 +0100
commiteec871fe405e140a1919999fe2f4cf24f1839e5d (patch)
treea37aaa6580925412ad7b71a758d2a39473f72afa /meta/classes/externalsrc.bbclass
parent29fa8ee01ef3254272bcbdd13a8c7244548639a3 (diff)
downloadopenembedded-core-eec871fe405e140a1919999fe2f4cf24f1839e5d.tar.gz
openembedded-core-eec871fe405e140a1919999fe2f4cf24f1839e5d.tar.bz2
openembedded-core-eec871fe405e140a1919999fe2f4cf24f1839e5d.zip
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. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/externalsrc.bbclass')
-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 () {
d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock")
# We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean)
- cleandirs = d.getVarFlag(task, 'cleandirs', False)
- if cleandirs:
- cleandirs = cleandirs.split()
- setvalue = False
- if '${S}' in cleandirs:
- cleandirs.remove('${S}')
+ cleandirs = (d.getVarFlag(task, 'cleandirs', False) or '').split()
+ setvalue = False
+ for cleandir in cleandirs[:]:
+ if d.expand(cleandir) == externalsrc:
+ cleandirs.remove(cleandir)
setvalue = True
- if externalsrcbuild == externalsrc and '${B}' in cleandirs:
- cleandirs.remove('${B}')
- setvalue = True
- if setvalue:
- d.setVarFlag(task, 'cleandirs', ' '.join(cleandirs))
+ if setvalue:
+ d.setVarFlag(task, 'cleandirs', ' '.join(cleandirs))
fetch_tasks = ['do_fetch', 'do_unpack']
# If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one