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:23:05 +0100 |
commit | 597c42f3df5d34a8dd7b4bcfe4fce725ae03a0bd (patch) | |
tree | c769bfbe025ac27a4708e4dfaa45cde35a156d9c | |
parent | 81b2eedb699069e69b188b22099f2324f700c293 (diff) | |
download | poky-597c42f3df5d34a8dd7b4bcfe4fce725ae03a0bd.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.
(From OE-Core rev: 222302810c472c8eb2efceaa757a253dcac5618f)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 | |||
14 | class Dot(object): | 14 | class Dot(object): |
15 | def __init__(self): | 15 | def __init__(self): |
16 | parser = argparse.ArgumentParser( | 16 | parser = argparse.ArgumentParser( |
17 | description="Analyse recipe-depends.dot generated by bitbake -g", | 17 | description="Analyse task-depends.dot generated by bitbake -g", |
18 | formatter_class=argparse.RawDescriptionHelpFormatter) | 18 | formatter_class=argparse.RawDescriptionHelpFormatter) |
19 | parser.add_argument("dotfile", | 19 | parser.add_argument("dotfile", |
20 | help = "Specify the dotfile", nargs = 1, action='store', default='') | 20 | help = "Specify the dotfile", nargs = 1, action='store', default='') |
@@ -159,9 +159,14 @@ Reduce the .dot file packages only, no tasks: | |||
159 | 159 | ||
160 | reverse_deps = [] | 160 | reverse_deps = [] |
161 | if self.args.why: | 161 | if self.args.why: |
162 | for k, v in depends.items(): | 162 | key_list = [self.args.key] |
163 | if self.args.key in v and not k in reverse_deps: | 163 | current_key = self.args.key |
164 | reverse_deps.append(k) | 164 | while (len(key_list) != 0): |
165 | current_key = key_list.pop() | ||
166 | for k, v in depends.items(): | ||
167 | if current_key in v and not k in reverse_deps: | ||
168 | reverse_deps.append(k) | ||
169 | key_list.append(k) | ||
165 | print('Because: %s' % ' '.join(reverse_deps)) | 170 | print('Because: %s' % ' '.join(reverse_deps)) |
166 | Dot.print_dep_chains(self.args.key, reverse_deps, depends) | 171 | Dot.print_dep_chains(self.args.key, reverse_deps, depends) |
167 | 172 | ||