[OE-core] [PATCH] externalsrc.bbclass: better filtering of cleandirs
Paul Eggleton
paul.eggleton at linux.intel.com
Tue Sep 8 10:48:02 UTC 2015
On Tuesday 08 September 2015 13:36:40 Markus Lehtonen wrote:
> 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 at linux.intel.com>
> ---
> meta/classes/externalsrc.bbclass | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/meta/classes/externalsrc.bbclass
> b/meta/classes/externalsrc.bbclass index 8f7f479..499688b 100644
> --- a/meta/classes/externalsrc.bbclass
> +++ b/meta/classes/externalsrc.bbclass
> @@ -58,18 +58,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
Acked-by: Paul Eggleton <paul.eggleton at linux.intel.com>
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
More information about the Openembedded-core
mailing list