From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: poky@yoctoproject.org
Subject: [PATCH 2/3] bitbake: add optional expansion to getVarFlag()
Date: Fri, 10 Dec 2010 15:30:30 +0000 [thread overview]
Message-ID: <d55fda9e70ac8490bbd0a4aaba87fd58df8d53ef.1292351445.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1292351445.git.paul.eggleton@linux.intel.com>
Add a parameter to getVarFlag() to auto-expand the value of the flag. This
makes getVarFlag() more consistent with getVar(), and allows expansion of
vardeps and vardepsexclude (which has been done in this commit).
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
bitbake/lib/bb/data.py | 4 ++--
bitbake/lib/bb/data_smart.py | 9 ++++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 0c95ebb..0aa8b40 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -296,8 +296,8 @@ def build_dependencies(key, keys, shelldeps, d):
parser = d.expandWithRefs(d.getVar(key, False), key)
deps |= parser.references
deps = deps | (keys & parser.execs)
- deps |= set((d.getVarFlag(key, "vardeps") or "").split())
- deps -= set((d.getVarFlag(key, "vardepsexclude") or "").split())
+ deps |= set((d.getVarFlag(key, "vardeps", True) or "").split())
+ deps -= set((d.getVarFlag(key, "vardepsexclude", True) or "").split())
except:
bb.note("Error expanding variable %s" % key)
raise
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index c8cd8f8..30f9cbc 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -277,12 +277,15 @@ class DataSmart:
self._makeShadowCopy(var)
self.dict[var][flag] = flagvalue
- def getVarFlag(self, var, flag):
+ def getVarFlag(self, var, flag, exp = False):
local_var = self._findVar(var)
+ value = None
if local_var:
if flag in local_var:
- return copy.copy(local_var[flag])
- return None
+ value = copy.copy(local_var[flag])
+ if exp and value:
+ value = self.expand(value, None)
+ return value
def delVarFlag(self, var, flag):
local_var = self._findVar(var)
--
1.7.1
next prev parent reply other threads:[~2010-12-14 18:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-14 18:30 [PATCH 0/3] reworked environment variable whitelisting fixes Paul Eggleton
2010-12-10 14:29 ` [PATCH 1/3] bitbake: allow excluding dependencies of variables Paul Eggleton
2010-12-10 15:30 ` Paul Eggleton [this message]
2010-12-14 18:09 ` [PATCH 3/3] poky.conf: adjust variable whitelisting to fix sstate checksums Paul Eggleton
2010-12-15 9:08 ` [PATCH 0/3] reworked environment variable whitelisting fixes Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d55fda9e70ac8490bbd0a4aaba87fd58df8d53ef.1292351445.git.paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.com \
--cc=poky@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox