From patchwork Tue Feb 28 03:22:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel,V2,1/1] bitbake: Added BBINCLUDED variable. Date: Tue, 28 Feb 2012 03:22:40 -0000 From: Lianhao Lu X-Patchwork-Id: 22199 Message-Id: <4b271df2df289b005593cf4f1e176434e6a6d852.1330399220.git.lianhao.lu@intel.com> To: bitbake-devel@lists.openembedded.org Added new variable BBINCLUDED indicating the file dependency information. It exposes the internal variable '__base_depends' and '__depends'. Signed-off-by: Lianhao Lu --- bitbake/lib/bb/cooker.py | 1 + bitbake/lib/bb/parse/__init__.py | 9 +++++++++ bitbake/lib/bb/parse/ast.py | 2 ++ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 12b526b..6ddd960 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -893,6 +893,7 @@ class BBCooker: bb.codeparser.parser_cache_init(data) bb.event.fire(bb.event.ConfigParsed(), data) bb.parse.init_parser(data) + data.setVar('BBINCLUDED',bb.parse.get_file_depends(data)) self.configuration.data = data self.configuration.data_hash = data.get_hash() diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 8b7ec73..7b9c47e 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py @@ -131,4 +131,13 @@ def vars_from_file(mypkg, d): parts.extend(tmplist) return parts +def get_file_depends(d): + '''Return the dependent files''' + dep_files = [] + depends = d.getVar('__depends', True) or set() + depends = depends.union(d.getVar('__base_depends', True) or set()) + for (fn, _) in depends: + dep_files.append(os.path.abspath(fn)) + return " ".join(dep_files) + from bb.parse.parse_py import __version__, ConfHandler, BBHandler diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 94fa175..7cef3d0 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py @@ -328,6 +328,8 @@ def finalize(fn, d, variant = None): bb.parse.siggen.finalise(fn, d, variant) + d.setVar('BBINCLUDED', bb.parse.get_file_depends(d)) + bb.event.fire(bb.event.RecipeParsed(fn), d) def _create_variants(datastores, names, function):