Skip to contentSkip to conversation

Added new variable BBINCLUDES

PATCH Superseded Lianhao Lu 2 participants 3 messages Feb 24, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lianhao Lu

author
#0 lore raw

cover Added new variable BBINCLUDES

This patch added a new variable BBINCLUDES to show the file dependency information. This kind of information could be used by others, i.e. recipe editors.

The following changes since commit a1f23a7cc527afdd1ce6cc7cd6083ee78fde09b3:
Otavio Salvador (1):
update-rc.d.bbclass: do nothing for extended cross packages

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib llu/bbincludes
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=llu/bbincludes

Lianhao Lu (1):
bitbake.conf: Added new variable BBINCLUDES

 meta/conf/bitbake.conf |    2 ++
 meta/lib/oe/utils.py   |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
author
#1 lore raw

PATCH 1/1 bitbake.conf: Added new variable BBINCLUDES

The new variable BBINCLUDES contains the file dependency information. It exposes the bitbake internal variable '__depends' and '__base_depends'.

---
 meta/conf/bitbake.conf |    2 ++
 meta/lib/oe/utils.py   |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
meta/conf/bitbake.conf +2 -0
index 90e5f7a..04851e5 100644
@@ -731,3 +731,5 @@ BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_
 
 MLPREFIX ??= ""
 MULTILIB_VARIANTS ??= ""
+
+BBINCLUDES = "${@oe.utils.get_file_depends(d)}"
meta/lib/oe/utils.py +9 -0
index 02d5442..b4dcc4f 100644
@@ -88,3 +88,12 @@ def param_bool(cfg, field, dflt = None):
 def inherits(d, *classes):
     """Return True if the metadata inherits any of the specified classes"""
     return any(bb.data.inherits_class(cls, d) for cls in classes)
+
+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, ctime) in depends:
+        dep_files.append(os.path.abspath(fn))
+    return " ".join(dep_files)
Signature · 1 line
1.7.0.4
#2 lore raw

Re: [PATCH 1/1] bitbake.conf: Added new variable BBINCLUDES

Quoted 26 lines · Lianhao Lu

The new variable BBINCLUDES contains the file dependency information. It exposes the bitbake internal variable '__depends' and '__base_depends'.

---
 meta/conf/bitbake.conf |    2 ++
 meta/lib/oe/utils.py   |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
meta/conf/bitbake.conf +2 -0
index 90e5f7a..04851e5 100644
@@ -731,3 +731,5 @@ BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_
 
 MLPREFIX ??= ""
 MULTILIB_VARIANTS ??= ""
+
+BBINCLUDES = "${@oe.utils.get_file_depends(d)}"
meta/lib/oe/utils.py +0 -0
index 02d5442..b4dcc4f 100644
@@ -88,3 +88,12 @@ def param_bool(cfg, field, dflt = None):
 def inherits(d, *classes):
     """Return True if the metadata inherits any of the specified classes"""

meta/lib/oe/utils.py def param_bool(cfg, field, dflt = None): · line 99

Quoted 10 lines
meta/lib/oe/utils.py +9 -0
     return any(bb.data.inherits_class(cls, d) for cls in classes)
+
+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, ctime) in depends:
+        dep_files.append(os.path.abspath(fn))
+    return " ".join(dep_files)

My big concern with this is that we're teaching lib/oe about bitbake internals like the layout and existence of those two variables. I think we need to do this within bitbake, maybe in ast.py:finalize() just before we fire the RecipeParsed() event.

Having thought more about it, I think we should call this variable BBINCLUDED since that more accurately reflects its contents.

Cheers,

Richard