[bitbake-devel] [PATCH 1/2] bb/parse: track parsed configuration files in __BB_PARSED_CONF
Joshua Lock
josh at linux.intel.com
Tue Aug 2 18:51:15 UTC 2011
Keep a list of each configuration (.conf) file which is handled by the
ConfHandler in the internal __BB_PARSED_CONF variable.
Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
lib/bb/parse/__init__.py | 12 +++++++++++-
lib/bb/parse/parse_py/ConfHandler.py | 2 ++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/lib/bb/parse/__init__.py b/lib/bb/parse/__init__.py
index eee8d9c..afe7681 100644
--- a/lib/bb/parse/__init__.py
+++ b/lib/bb/parse/__init__.py
@@ -59,13 +59,23 @@ def update_mtime(f):
__mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
return __mtime_cache[f]
-def mark_dependency(d, f):
+def full_path(f):
if f.startswith('./'):
f = "%s/%s" % (os.getcwd(), f[2:])
+ return f
+
+def mark_dependency(d, f):
+ full_path(f)
deps = bb.data.getVar('__depends', d) or set()
deps.update([(f, cached_mtime(f))])
bb.data.setVar('__depends', deps, d)
+def track_conf(d, f):
+ full_path(f)
+ conf = bb.data.getVar('__BB_PARSED_CONF', d) or []
+ conf.append(f)
+ bb.data.setVar('__BB_PARSED_CONF', conf, d)
+
def supports(fn, data):
"""Returns true if we have a handler for this file, false otherwise"""
for h in handlers:
diff --git a/lib/bb/parse/parse_py/ConfHandler.py b/lib/bb/parse/parse_py/ConfHandler.py
index 102c0e9..953ef87 100644
--- a/lib/bb/parse/parse_py/ConfHandler.py
+++ b/lib/bb/parse/parse_py/ConfHandler.py
@@ -85,6 +85,8 @@ def handle(fn, data, include):
if include:
bb.parse.mark_dependency(data, abs_fn)
+ bb.parse.track_conf(data, abs_fn)
+
statements = ast.StatementGroup()
lineno = 0
while True:
--
1.7.6
More information about the bitbake-devel
mailing list