summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-06-01 11:09:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-01 14:08:32 +0100
commit58bdecbc43390796e7050ad9e0033176716ec423 (patch)
tree1ed865a129e58ef6b89564c5554a41c5d710b2bd /bitbake
parentdc65caa889dc384334c77d229e2754ed96380e64 (diff)
downloadpoky-58bdecbc43390796e7050ad9e0033176716ec423.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] (Bitbake rev: a8ab0af776ba20c83832215054180fbd15c274c0) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 397352945e..0b52f182ea 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -405,6 +405,15 @@ class BBCooker:
405 print("}", file=tdepends_file) 405 print("}", file=tdepends_file)
406 logger.info("Task dependencies saved to 'task-depends.dot'") 406 logger.info("Task dependencies saved to 'task-depends.dot'")
407 407
408 def calc_bbfile_priority( self, filename, matched = None ):
409 for _, _, regex, pri in self.status.bbfile_config_priorities:
410 if regex.match(filename):
411 if matched != None:
412 if not regex in matched:
413 matched.add(regex)
414 return pri
415 return 0
416
408 def buildDepgraph( self ): 417 def buildDepgraph( self ):
409 all_depends = self.status.all_depends 418 all_depends = self.status.all_depends
410 pn_provides = self.status.pn_provides 419 pn_provides = self.status.pn_provides
@@ -413,15 +422,6 @@ class BBCooker:
413 bb.data.update_data(localdata) 422 bb.data.update_data(localdata)
414 bb.data.expandKeys(localdata) 423 bb.data.expandKeys(localdata)
415 424
416 matched = set()
417 def calc_bbfile_priority(filename):
418 for _, _, regex, pri in self.status.bbfile_config_priorities:
419 if regex.match(filename):
420 if not regex in matched:
421 matched.add(regex)
422 return pri
423 return 0
424
425 # Handle PREFERRED_PROVIDERS 425 # Handle PREFERRED_PROVIDERS
426 for p in (bb.data.getVar('PREFERRED_PROVIDERS', localdata, 1) or "").split(): 426 for p in (bb.data.getVar('PREFERRED_PROVIDERS', localdata, 1) or "").split():
427 try: 427 try:
@@ -434,8 +434,9 @@ class BBCooker:
434 self.status.preferred[providee] = provider 434 self.status.preferred[providee] = provider
435 435
436 # Calculate priorities for each file 436 # Calculate priorities for each file
437 matched = set()
437 for p in self.status.pkg_fn: 438 for p in self.status.pkg_fn:
438 self.status.bbfile_priority[p] = calc_bbfile_priority(p) 439 self.status.bbfile_priority[p] = self.calc_bbfile_priority(p, matched)
439 440
440 # Don't show the warning if the BBFILE_PATTERN did match .bbappend files 441 # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
441 unmatched = set() 442 unmatched = set()
@@ -950,6 +951,9 @@ class BBCooker:
950 files = (data.getVar( "BBFILES", self.configuration.data, 1 ) or "").split() 951 files = (data.getVar( "BBFILES", self.configuration.data, 1 ) or "").split()
951 data.setVar("BBFILES", " ".join(files), self.configuration.data) 952 data.setVar("BBFILES", " ".join(files), self.configuration.data)
952 953
954 # Sort files by priority
955 files.sort( key=lambda fileitem: self.calc_bbfile_priority(fileitem) )
956
953 if not len(files): 957 if not len(files):
954 files = self.get_bbfiles() 958 files = self.get_bbfiles()
955 959