From 4dd6d9139cb77f2b0ff7ab9482e853108efad5aa Mon Sep 17 00:00:00 2001 From: Peter Seebach Date: Fri, 18 Jan 2013 11:45:22 +0000 Subject: bitbake: bitbake: data_smart.py and friends: Track file inclusions for bitbake -e This code adds inclusion history to bitbake -e output, showing which files were included, in what order. This doesn't completely resolve timing questions, because it doesn't show you which lines of a file were processed before or after a given include, but it does let you figure out what the path was by which a particular file ended up in your build at all. How it works: data_smart acquires a .history member, which is an IncludeHistory; this represents the inclusion of a file and all its inclusions, recursively. It provides methods for including files, for finishing inclusion (done as an __exit__), and for dumping the whole tree. The parser is modified to run includes inside a with() to push and pop the include filename. RP Modifications: a) Split Include and Variable tracking b) Replace deepcopy usage with dedicated copy function c) Simplify some variable and usage (Bitbake rev: b2dda721262da8abb7dc32d019e18fbc32ed8860) Signed-off-by: Peter Seebach Signed-off-by: Richard Purdie --- bitbake/lib/bb/parse/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/parse') diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 4293d09c7a..3f93ad2e6a 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py @@ -87,7 +87,8 @@ def handle(fn, data, include = 0): """Call the handler that is appropriate for this file""" for h in handlers: if h['supports'](fn, data): - return h['handle'](fn, data, include) + with data.inchistory.include(fn): + return h['handle'](fn, data, include) raise ParseError("not a BitBake file", fn) def init(fn, data): -- cgit v1.2.3-54-g00ecf