summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-02-29 22:15:19 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-01 15:51:34 +0000
commitca566412b1d557ef52c599dccb4464a95227bc54 (patch)
tree576ec940bcc3a052d6ad699e24795a1a39ee1ec0
parent2d2394320981c04d93c74fc348449cf896cf4b40 (diff)
downloadpoky-ca566412b1d557ef52c599dccb4464a95227bc54.tar.gz
cooker: fix calculating of depends and rdepends
Remove part of the original logic that stores pkg dependency and pkg recomends, which will not be used in Hob. Add the judgement for preferred fn provider of a certain package, which maps package name to its providing recipe name. The above approaches correct the build dependency calculation, and they also reduced the total depend_tree size, which speed up the tree data generation time. (Bitbake rev: d668eb1300b3b3115964e98127b1bef554caae17) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cooker.py45
1 files changed, 10 insertions, 35 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 303cd006b8..558eadd00f 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -442,19 +442,6 @@ class BBCooker:
442 442
443 return depend_tree 443 return depend_tree
444 444
445 def append_package(self, taskdata, depend_tree_package, package):
446 if package not in depend_tree_package:
447 targetid = taskdata.getrun_id(package)
448 if targetid in taskdata.run_targets and taskdata.run_targets[targetid]:
449 fnid = taskdata.run_targets[targetid][0]
450 fn = taskdata.fn_index[fnid]
451 pn = self.status.pkg_fn[fn]
452 version = "%s:%s-%s" % self.status.pkg_pepvpr[fn]
453 depend_tree_package[package] = {}
454 depend_tree_package[package]["pn"] = pn
455 depend_tree_package[package]["filename"] = fn
456 depend_tree_package[package]["version"] = version
457
458 def generatePkgDepTreeData(self, pkgs_to_build, task): 445 def generatePkgDepTreeData(self, pkgs_to_build, task):
459 """ 446 """
460 Create a dependency tree of pkgs_to_build, returning the data. 447 Create a dependency tree of pkgs_to_build, returning the data.
@@ -470,7 +457,6 @@ class BBCooker:
470 depend_tree["depends"] = {} 457 depend_tree["depends"] = {}
471 depend_tree["pn"] = {} 458 depend_tree["pn"] = {}
472 depend_tree["rdepends-pn"] = {} 459 depend_tree["rdepends-pn"] = {}
473 depend_tree["packages"] = {}
474 depend_tree["rdepends-pkg"] = {} 460 depend_tree["rdepends-pkg"] = {}
475 depend_tree["rrecs-pkg"] = {} 461 depend_tree["rrecs-pkg"] = {}
476 462
@@ -497,7 +483,6 @@ class BBCooker:
497 483
498 if fnid not in seen_fnids: 484 if fnid not in seen_fnids:
499 seen_fnids.append(fnid) 485 seen_fnids.append(fnid)
500 packages = []
501 486
502 depend_tree["depends"][pn] = [] 487 depend_tree["depends"][pn] = []
503 for dep in taskdata.depids[fnid]: 488 for dep in taskdata.depids[fnid]:
@@ -514,26 +499,16 @@ class BBCooker:
514 499
515 depend_tree["rdepends-pn"][pn] = [] 500 depend_tree["rdepends-pn"][pn] = []
516 for rdep in taskdata.rdepids[fnid]: 501 for rdep in taskdata.rdepids[fnid]:
517 depend_tree["rdepends-pn"][pn].append(taskdata.run_names_index[rdep]) 502 item = taskdata.run_names_index[rdep]
518 503 pn_rprovider = ""
519 for package in rdepends: 504 targetid = taskdata.getrun_id(item)
520 depend_tree["rdepends-pkg"][package] = [] 505 if targetid in taskdata.run_targets and taskdata.run_targets[targetid]:
521 for rdepend in rdepends[package]: 506 id = taskdata.run_targets[targetid][0]
522 depend_tree["rdepends-pkg"][package].append(rdepend) 507 fn_rprovider = taskdata.fn_index[id]
523 self.append_package(taskdata, depend_tree["packages"], rdepend) 508 pn_rprovider = self.status.pkg_fn[fn_rprovider]
524 if not package in packages: 509 else:
525 packages.append(package) 510 pn_rprovider = item
526 511 depend_tree["rdepends-pn"][pn].append(pn_rprovider)
527 for package in rrecs:
528 depend_tree["rrecs-pkg"][package] = []
529 for rrec in rrecs[package]:
530 depend_tree["rrecs-pkg"][package].append(rrec)
531 self.append_package(taskdata, depend_tree["packages"], rrec)
532 if not package in packages:
533 packages.append(package)
534
535 for package in packages:
536 self.append_package(taskdata, depend_tree["packages"], package)
537 512
538 return depend_tree 513 return depend_tree
539 514