diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-04-04 23:02:35 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-04-05 14:49:06 +0100 |
commit | eb37cdd8908380e02460111f1739bd1cc0a22d8e (patch) | |
tree | d79d2c6e1263f42dc5a299f0e419c93b91c4090c | |
parent | 9e3a9637b8f86f504e187b96cd0c98d8e1f651da (diff) | |
download | poky-eb37cdd8908380e02460111f1739bd1cc0a22d8e.tar.gz |
classes/externalsrc: handle if cleandirs contains python expressions
Use the existing oe.recipeutils.split_var_value() function to split the
unexpanded value of the cleandirs varflag, in case it contains python
expressions - we don't want to split the expression itself as the chunks
will not expand properly individually and we can miss something that
expands to the source tree (and thus it can get deleted, the avoidance
of which is the whole point of this code).
(From OE-Core rev: 611cee69d7300a4746edd752c9557af60e7beecc)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/externalsrc.bbclass | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index 3f1d39689b..ce8517c58b 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass | |||
@@ -53,6 +53,8 @@ python () { | |||
53 | d.setVar('BB_DONT_CACHE', '1') | 53 | d.setVar('BB_DONT_CACHE', '1') |
54 | 54 | ||
55 | if externalsrc: | 55 | if externalsrc: |
56 | import oe.recipeutils | ||
57 | |||
56 | d.setVar('S', externalsrc) | 58 | d.setVar('S', externalsrc) |
57 | if externalsrcbuild: | 59 | if externalsrcbuild: |
58 | d.setVar('B', externalsrcbuild) | 60 | d.setVar('B', externalsrcbuild) |
@@ -85,7 +87,7 @@ python () { | |||
85 | d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock") | 87 | d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock") |
86 | 88 | ||
87 | # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean) | 89 | # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean) |
88 | cleandirs = (d.getVarFlag(task, 'cleandirs', False) or '').split() | 90 | cleandirs = oe.recipeutils.split_var_value(d.getVarFlag(task, 'cleandirs', False) or '') |
89 | setvalue = False | 91 | setvalue = False |
90 | for cleandir in cleandirs[:]: | 92 | for cleandir in cleandirs[:]: |
91 | if d.expand(cleandir) == externalsrc: | 93 | if d.expand(cleandir) == externalsrc: |