diff options
| author | Rusty Howell <rhowell@control4.com> | 2023-07-03 13:47:54 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-07-12 05:11:37 -1000 |
| commit | c4d91873aff004267b75913572d7f3c2ba104636 (patch) | |
| tree | 3274b552daca8215ea6d8af7563842d260fd77ad /scripts | |
| parent | a834d9001bb01e6aa893cc1f78aedc1bb7276105 (diff) | |
| download | poky-c4d91873aff004267b75913572d7f3c2ba104636.tar.gz | |
oe-depends-dot: Handle new format for task-depends.dot
The .dot file created by `bitbake -g` changed formats a while ago, which
broke oe-depends-dot.
Also add some useful examples to the --help output.
(From OE-Core rev: e53842ea6c14ed8e97252626e3ae0d3cf4580fbc)
Signed-off-by: Rusty Howell <rustyhowell@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/oe-depends-dot | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/scripts/oe-depends-dot b/scripts/oe-depends-dot index 5eb3e12769..1c2d51c6ec 100755 --- a/scripts/oe-depends-dot +++ b/scripts/oe-depends-dot | |||
| @@ -15,7 +15,7 @@ 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 recipe-depends.dot generated by bitbake -g", |
| 18 | epilog="Use %(prog)s --help to get help") | 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='') |
| 21 | parser.add_argument("-k", "--key", | 21 | parser.add_argument("-k", "--key", |
| @@ -32,6 +32,21 @@ class Dot(object): | |||
| 32 | " For example, A->B, B->C, A->C, then A->C can be removed.", | 32 | " For example, A->B, B->C, A->C, then A->C can be removed.", |
| 33 | action="store_true", default=False) | 33 | action="store_true", default=False) |
| 34 | 34 | ||
| 35 | parser.epilog = """ | ||
| 36 | Examples: | ||
| 37 | First generate the .dot file: | ||
| 38 | bitbake -g core-image-minimal | ||
| 39 | |||
| 40 | To find out why a package is being built: | ||
| 41 | %(prog)s -k <package> -w ./task-depends.dot | ||
| 42 | |||
| 43 | To find out what a package depends on: | ||
| 44 | %(prog)s -k <package> -d ./task-depends.dot | ||
| 45 | |||
| 46 | Reduce the .dot file packages only, no tasks: | ||
| 47 | %(prog)s -r ./task-depends.dot | ||
| 48 | """ | ||
| 49 | |||
| 35 | self.args = parser.parse_args() | 50 | self.args = parser.parse_args() |
| 36 | 51 | ||
| 37 | if len(sys.argv) != 3 and len(sys.argv) < 5: | 52 | if len(sys.argv) != 3 and len(sys.argv) < 5: |
| @@ -99,6 +114,10 @@ class Dot(object): | |||
| 99 | if key == "meta-world-pkgdata": | 114 | if key == "meta-world-pkgdata": |
| 100 | continue | 115 | continue |
| 101 | dep = m.group(2) | 116 | dep = m.group(2) |
| 117 | key = key.split('.')[0] | ||
| 118 | dep = dep.split('.')[0] | ||
| 119 | if key == dep: | ||
| 120 | continue | ||
| 102 | if key in depends: | 121 | if key in depends: |
| 103 | if not key in depends[key]: | 122 | if not key in depends[key]: |
| 104 | depends[key].add(dep) | 123 | depends[key].add(dep) |
