summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-06-01 11:09:34 +0100
committerChris Larson <chris_larson@mentor.com>2011-08-15 17:17:01 -0700
commit2d723edf1e695c11f5e1be636450fb351e2ee30e (patch)
tree0755ca0d869a7b0e9c9375ee2a6a227e741d05bf /lib
parent826370e683edb6bfd7cf0b6bf45ee69260517bb8 (diff)
downloadbitbake-2d723edf1e695c11f5e1be636450fb351e2ee30e.tar.gz
bitbake: use layer priority when applying bbappends
If the priority of a layer has been specified with BBFILE_PRIORITY_ then use that to sort the list of BBFILES entries, which will affect the order in which .bbappend files are applied. Fixes [YOCTO #1125] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/cooker.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 4fb313e93..bb2627293 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -393,6 +393,15 @@ class BBCooker:
print("}", file=tdepends_file)
logger.info("Task dependencies saved to 'task-depends.dot'")
+ def calc_bbfile_priority( self, filename, matched = None ):
+ for _, _, regex, pri in self.status.bbfile_config_priorities:
+ if regex.match(filename):
+ if matched != None:
+ if not regex in matched:
+ matched.add(regex)
+ return pri
+ return 0
+
def buildDepgraph( self ):
all_depends = self.status.all_depends
pn_provides = self.status.pn_provides
@@ -401,15 +410,6 @@ class BBCooker:
bb.data.update_data(localdata)
bb.data.expandKeys(localdata)
- matched = set()
- def calc_bbfile_priority(filename):
- for _, _, regex, pri in self.status.bbfile_config_priorities:
- if regex.match(filename):
- if not regex in matched:
- matched.add(regex)
- return pri
- return 0
-
# Handle PREFERRED_PROVIDERS
for p in (bb.data.getVar('PREFERRED_PROVIDERS', localdata, 1) or "").split():
try:
@@ -422,8 +422,9 @@ class BBCooker:
self.status.preferred[providee] = provider
# Calculate priorities for each file
+ matched = set()
for p in self.status.pkg_fn:
- self.status.bbfile_priority[p] = calc_bbfile_priority(p)
+ self.status.bbfile_priority[p] = self.calc_bbfile_priority(p, matched)
# Don't show the warning if the BBFILE_PATTERN did match .bbappend files
unmatched = set()
@@ -848,6 +849,9 @@ class BBCooker:
files = (data.getVar( "BBFILES", self.configuration.data, 1 ) or "").split()
data.setVar("BBFILES", " ".join(files), self.configuration.data)
+ # Sort files by priority
+ files.sort( key=lambda fileitem: self.calc_bbfile_priority(fileitem) )
+
if not len(files):
files = self.get_bbfiles()