diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2023-08-30 01:21:58 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-02 18:17:30 +0100 |
commit | 222302810c472c8eb2efceaa757a253dcac5618f (patch) | |
tree | 0f7721fd443460940cf5dc0bb27b51b932c491d0 /scripts/oe-depends-dot | |
parent | 3270f6f3bcb7811fd5e576808c086428f1a8c568 (diff) | |
download | openembedded-core-contrib-222302810c472c8eb2efceaa757a253dcac5618f.tar.gz |
oe-depends-dot: improve '-w' behavior
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 <Qi.Chen@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'scripts/oe-depends-dot')
-rwxr-xr-x | scripts/oe-depends-dot | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/oe-depends-dot b/scripts/oe-depends-dot index 1c2d51c6ec..d02ee455f6 100755 --- a/scripts/oe-depends-dot +++ b/scripts/oe-depends-dot @@ -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) |