oe-depends-dot: improve '-w' behavior
PATCH 1/1 oe-depends-dot: improve '-w' behavior
From: Chen Qi <[email protected]>
The '-w' option is not giving very helpful information. For example, if we add 'spice' to IMAGE_INSTALL, bitbake -g core-image-minimal, and then run `oe-depends-dot -k nspr -w task-depends.dot', the result is:
$ oe-depends-dot -k nspr -w task-depends.dot Because: core-image-minimal nss core-image-minimal -> nss -> nspr
The result is not showing the full dependency chain which brings in nspr. With this patch, the result is:
$ oe-depends-dot -k nspr -w task-depends.dot Because: core-image-minimal nss libcacard spice core-image-minimal -> spice -> libcacard -> nss -> nspr
This patch also fixes a typo in help message: recipe-depends.dot -> task-depends.dot.
Signed-off-by Chen Qi <[email protected]>
--- scripts/oe-depends-dot | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
scripts/oe-depends-dot +9 -4
@@ -14,7 +14,7 @@ import re class Dot(object): def __init__(self): parser = argparse.ArgumentParser( - description="Analyse recipe-depends.dot generated by bitbake -g", + description="Analyse task-depends.dot generated by bitbake -g", formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument("dotfile", help = "Specify the dotfile", nargs = 1, action='store', default='')
@@ -159,9 +159,14 @@ Reduce the .dot file packages only, no tasks: reverse_deps = [] if self.args.why: - for k, v in depends.items(): - if self.args.key in v and not k in reverse_deps: - reverse_deps.append(k) + key_list = [self.args.key] + current_key = self.args.key + while (len(key_list) != 0): + current_key = key_list.pop() + for k, v in depends.items(): + if current_key in v and not k in reverse_deps: + reverse_deps.append(k) + key_list.append(k) print('Because: %s' % ' '.join(reverse_deps)) Dot.print_dep_chains(self.args.key, reverse_deps, depends)
Signature · 1 line
2.40.0