diff options
Diffstat (limited to 'bitbake/bin/bitbake-layers')
-rwxr-xr-x | bitbake/bin/bitbake-layers | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers index 2a7f82998b..826a3e7a57 100755 --- a/bitbake/bin/bitbake-layers +++ b/bitbake/bin/bitbake-layers | |||
@@ -566,26 +566,29 @@ Recipes are listed with the bbappends that apply to them as subitems. | |||
566 | def do_show_cross_depends(self, args): | 566 | def do_show_cross_depends(self, args): |
567 | """figure out the dependency between recipes that crosses a layer boundary. | 567 | """figure out the dependency between recipes that crosses a layer boundary. |
568 | 568 | ||
569 | usage: show-cross-depends [-f] | 569 | usage: show-cross-depends [-f] [-i layer1[,layer2[,layer3...]]] |
570 | 570 | ||
571 | Figure out the dependency between recipes that crosses a layer boundary. | 571 | Figure out the dependency between recipes that crosses a layer boundary. |
572 | 572 | ||
573 | Options: | 573 | Options: |
574 | -f show full file path | 574 | -f show full file path |
575 | -i ignore dependencies on items in the specified layer(s) | ||
575 | 576 | ||
576 | NOTE: | 577 | NOTE: |
577 | The .bbappend file can impact the dependency. | 578 | The .bbappend file can impact the dependency. |
578 | """ | 579 | """ |
579 | self.init_bbhandler() | 580 | import optparse |
580 | 581 | ||
581 | show_filenames = False | 582 | parser = optparse.OptionParser(usage="show-cross-depends [-f] [-i layer1[,layer2[,layer3...]]]") |
582 | for arg in args.split(): | 583 | parser.add_option("-f", "", |
583 | if arg == '-f': | 584 | action="store_true", dest="show_filenames") |
584 | show_filenames = True | 585 | parser.add_option("-i", "", |
585 | else: | 586 | action="store", dest="ignore_layers", default="") |
586 | sys.stderr.write("show-cross-depends: invalid option %s\n" % arg) | 587 | |
587 | self.do_help('') | 588 | options, args = parser.parse_args(sys.argv) |
588 | return | 589 | ignore_layers = options.ignore_layers.split(',') |
590 | |||
591 | self.init_bbhandler() | ||
589 | 592 | ||
590 | pkg_fn = self.bbhandler.cooker_data.pkg_fn | 593 | pkg_fn = self.bbhandler.cooker_data.pkg_fn |
591 | bbpath = str(self.bbhandler.config_data.getVar('BBPATH', True)) | 594 | bbpath = str(self.bbhandler.config_data.getVar('BBPATH', True)) |
@@ -607,7 +610,7 @@ The .bbappend file can impact the dependency. | |||
607 | self.bbhandler.config_data, | 610 | self.bbhandler.config_data, |
608 | self.bbhandler.cooker_data, | 611 | self.bbhandler.cooker_data, |
609 | self.bbhandler.cooker_data.pkg_pn) | 612 | self.bbhandler.cooker_data.pkg_pn) |
610 | self.check_cross_depends("DEPENDS", layername, f, best[3], show_filenames) | 613 | self.check_cross_depends("DEPENDS", layername, f, best[3], options.show_filenames, ignore_layers) |
611 | 614 | ||
612 | # The RDPENDS | 615 | # The RDPENDS |
613 | all_rdeps = self.bbhandler.cooker_data.rundeps[f].values() | 616 | all_rdeps = self.bbhandler.cooker_data.rundeps[f].values() |
@@ -624,7 +627,7 @@ The .bbappend file can impact the dependency. | |||
624 | best = bb.providers.filterProvidersRunTime(all_p, rdep, | 627 | best = bb.providers.filterProvidersRunTime(all_p, rdep, |
625 | self.bbhandler.config_data, | 628 | self.bbhandler.config_data, |
626 | self.bbhandler.cooker_data)[0][0] | 629 | self.bbhandler.cooker_data)[0][0] |
627 | self.check_cross_depends("RDEPENDS", layername, f, best, show_filenames) | 630 | self.check_cross_depends("RDEPENDS", layername, f, best, options.show_filenames, ignore_layers) |
628 | 631 | ||
629 | # The inherit class | 632 | # The inherit class |
630 | cls_re = re.compile('classes/') | 633 | cls_re = re.compile('classes/') |
@@ -635,8 +638,8 @@ The .bbappend file can impact the dependency. | |||
635 | # ignore the classes/cls. | 638 | # ignore the classes/cls. |
636 | if not cls_re.match(cls): | 639 | if not cls_re.match(cls): |
637 | inherit_layername = self.get_file_layer(cls) | 640 | inherit_layername = self.get_file_layer(cls) |
638 | if inherit_layername != layername: | 641 | if inherit_layername != layername and not inherit_layername in ignore_layers: |
639 | if not show_filenames: | 642 | if not options.show_filenames: |
640 | f_short = self.remove_layer_prefix(f) | 643 | f_short = self.remove_layer_prefix(f) |
641 | cls = self.remove_layer_prefix(cls) | 644 | cls = self.remove_layer_prefix(cls) |
642 | else: | 645 | else: |
@@ -656,7 +659,7 @@ The .bbappend file can impact the dependency. | |||
656 | if pv_re.search(needed_file) and f in self.bbhandler.cooker_data.pkg_pepvpr: | 659 | if pv_re.search(needed_file) and f in self.bbhandler.cooker_data.pkg_pepvpr: |
657 | pv = self.bbhandler.cooker_data.pkg_pepvpr[f][1] | 660 | pv = self.bbhandler.cooker_data.pkg_pepvpr[f][1] |
658 | needed_file = re.sub(r"\${PV}", pv, needed_file) | 661 | needed_file = re.sub(r"\${PV}", pv, needed_file) |
659 | self.print_cross_files(bbpath, keyword, layername, f, needed_file, show_filenames) | 662 | self.print_cross_files(bbpath, keyword, layername, f, needed_file, options.show_filenames, ignore_layers) |
660 | line = fnfile.readline() | 663 | line = fnfile.readline() |
661 | fnfile.close() | 664 | fnfile.close() |
662 | 665 | ||
@@ -683,21 +686,22 @@ The .bbappend file can impact the dependency. | |||
683 | bbclass=".bbclass" | 686 | bbclass=".bbclass" |
684 | # Find a 'require/include xxxx' | 687 | # Find a 'require/include xxxx' |
685 | if m: | 688 | if m: |
686 | self.print_cross_files(bbpath, keyword, layername, f, m.group(1) + bbclass, show_filenames) | 689 | self.print_cross_files(bbpath, keyword, layername, f, m.group(1) + bbclass, options.show_filenames, ignore_layers) |
687 | line = ffile.readline() | 690 | line = ffile.readline() |
688 | ffile.close() | 691 | ffile.close() |
689 | 692 | ||
690 | def print_cross_files(self, bbpath, keyword, layername, f, needed_filename, show_filenames): | 693 | def print_cross_files(self, bbpath, keyword, layername, f, needed_filename, show_filenames, ignore_layers): |
691 | """Print the depends that crosses a layer boundary""" | 694 | """Print the depends that crosses a layer boundary""" |
692 | needed_file = bb.utils.which(bbpath, needed_filename) | 695 | needed_file = bb.utils.which(bbpath, needed_filename) |
693 | if needed_file: | 696 | if needed_file: |
694 | # Which layer is this file from | 697 | # Which layer is this file from |
695 | needed_layername = self.get_file_layer(needed_file) | 698 | needed_layername = self.get_file_layer(needed_file) |
696 | if needed_layername != layername: | 699 | if needed_layername != layername and not needed_layername in ignore_layers: |
697 | if not show_filenames: | 700 | if not show_filenames: |
698 | f = self.remove_layer_prefix(f) | 701 | f = self.remove_layer_prefix(f) |
699 | needed_file = self.remove_layer_prefix(needed_file) | 702 | needed_file = self.remove_layer_prefix(needed_file) |
700 | logger.plain("%s %s %s" %(f, keyword, needed_file)) | 703 | logger.plain("%s %s %s" %(f, keyword, needed_file)) |
704 | |||
701 | def match_inherit(self, line): | 705 | def match_inherit(self, line): |
702 | """Match the inherit xxx line""" | 706 | """Match the inherit xxx line""" |
703 | return (self.inherit_re.match(line), "inherits") | 707 | return (self.inherit_re.match(line), "inherits") |
@@ -711,11 +715,11 @@ The .bbappend file can impact the dependency. | |||
711 | keyword = "includes" | 715 | keyword = "includes" |
712 | return (m, keyword) | 716 | return (m, keyword) |
713 | 717 | ||
714 | def check_cross_depends(self, keyword, layername, f, needed_file, show_filenames): | 718 | def check_cross_depends(self, keyword, layername, f, needed_file, show_filenames, ignore_layers): |
715 | """Print the DEPENDS/RDEPENDS file that crosses a layer boundary""" | 719 | """Print the DEPENDS/RDEPENDS file that crosses a layer boundary""" |
716 | best_realfn = bb.cache.Cache.virtualfn2realfn(needed_file)[0] | 720 | best_realfn = bb.cache.Cache.virtualfn2realfn(needed_file)[0] |
717 | needed_layername = self.get_file_layer(best_realfn) | 721 | needed_layername = self.get_file_layer(best_realfn) |
718 | if needed_layername != layername: | 722 | if needed_layername != layername and not needed_layername in ignore_layers: |
719 | if not show_filenames: | 723 | if not show_filenames: |
720 | f = self.remove_layer_prefix(f) | 724 | f = self.remove_layer_prefix(f) |
721 | best_realfn = self.remove_layer_prefix(best_realfn) | 725 | best_realfn = self.remove_layer_prefix(best_realfn) |