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>
This commit is contained in:
Markus Lehtonen 2015-09-08 13:36:40 +03:00 committed by Richard Purdie
parent f0af24eedf
commit 9a24b6b123
1 changed files with 7 additions and 11 deletions

View File

@ -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