summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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