All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rusty Howell" <rustyhowell@gmail.com>
To: poky@lists.yoctoproject.org
Cc: Rusty Howell <rhowell@control4.com>,
	Rusty Howell <rustyhowell@gmail.com>
Subject: [PATCH] oe-depends-dot: Handle new format for task-depends.dot
Date: Tue, 24 May 2022 15:02:40 -0600	[thread overview]
Message-ID: <20220524210240.3223272-1-rustyhowell@gmail.com> (raw)

From: Rusty Howell <rhowell@control4.com>

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.

Signed-off-by: Rusty Howell <rustyhowell@gmail.com>
---
 scripts/oe-depends-dot | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

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):
     def __init__(self):
         parser = argparse.ArgumentParser(
             description="Analyse recipe-depends.dot generated by bitbake -g",
-            epilog="Use %(prog)s --help to get help")
+            formatter_class=argparse.RawDescriptionHelpFormatter)
         parser.add_argument("dotfile",
             help = "Specify the dotfile", nargs = 1, action='store', default='')
         parser.add_argument("-k", "--key",
@@ -32,6 +32,21 @@ class Dot(object):
                     " For example, A->B, B->C, A->C, then A->C can be removed.",
             action="store_true", default=False)
 
+        parser.epilog = """
+Examples:
+First generate the .dot file:
+    bitbake -g core-image-minimal
+
+To find out why a package is being built:
+    %(prog)s -k <package> -w ./task-depends.dot
+
+To find out what a package depends on:
+    %(prog)s -k <package> -d ./task-depends.dot
+
+Reduce the .dot file packages only, no tasks:
+    %(prog)s -r ./task-depends.dot
+"""
+
         self.args = parser.parse_args()
 
         if len(sys.argv) != 3 and len(sys.argv) < 5:
@@ -99,6 +114,10 @@ class Dot(object):
                 if key == "meta-world-pkgdata":
                     continue
                 dep = m.group(2)
+                key = key.split('.')[0]
+                dep = dep.split('.')[0]
+                if key == dep:
+                    continue
                 if key in depends:
                     if not key in depends[key]:
                         depends[key].add(dep)
-- 
2.25.1


             reply	other threads:[~2022-05-24 21:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 21:02 Rusty Howell [this message]
2022-05-25  8:45 ` [poky] [PATCH] oe-depends-dot: Handle new format for task-depends.dot Luca Ceresoli
     [not found]   ` <CAE+BM3kGWGTcOaAS9bD=z3W6fY6MpU0EmXLkkw4zW5TFZ5sSbg@mail.gmail.com>
2022-05-26 12:35     ` Luca Ceresoli
2022-05-29 23:27 ` Steve Sakoman
2023-01-09 11:17   ` [OE-core] " Quentin Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220524210240.3223272-1-rustyhowell@gmail.com \
    --to=rustyhowell@gmail.com \
    --cc=poky@lists.yoctoproject.org \
    --cc=rhowell@control4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.