From patchwork Mon Jul 3 13:50:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Meusel X-Patchwork-Id: 26811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E7CFEB64DD for ; Mon, 3 Jul 2023 13:51:02 +0000 (UTC) Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web11.32954.1688392259332417369 for ; Mon, 03 Jul 2023 06:50:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@posteo.de header.s=2017 header.b=XIbQ3ZNM; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: christian.meusel@posteo.de) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B84C4240104 for ; Mon, 3 Jul 2023 15:50:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1688392256; bh=pFJZhFcKbwlBnmWQOyY38xM5OwNObHWFykKi/bYlhZE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=XIbQ3ZNM/3WijUhQpdGqElm2RxB89dh8iX7vKZLT5GCfwgL7/gsPvBJLPjmgsERo3 rhzR+zTE5xTVRA7AJdFprAnl/PmnNPdSaKqcTUZxTKMsqMz/YWlJWVWnBy7L3Qorn1 uluQu6dkWXYGGpk2AiHxois1LZFlwCI9PP0dKLAEBq68wNQoCRhu01RiQyGfO16jNX ufAugUKrjpnFHgjalTw2OhWBat902FJLg9hT/K7zqEBv/kF2V2FIsczzYAIED67gCH iSVCxKGKproXk6OLY/rSdgknv/wIpfGYtQntMyn9Lq8sv4uaTiQ9++UC4I1NKXV4s4 QYGdS4U32DyQg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QvnPq6CYsz9rxP; Mon, 3 Jul 2023 15:50:55 +0200 (CEST) From: Christian Meusel To: openembedded-core@lists.openembedded.org Cc: Rusty Howell , Rusty Howell , Luca Ceresoli , Richard Purdie Subject: [dunfell][PATCH] oe-depends-dot: Handle new format for task-depends.dot Date: Mon, 3 Jul 2023 13:50:40 +0000 Message-Id: <20230703135040.903608-1-christian.meusel@posteo.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 03 Jul 2023 13:51:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183804 From: Rusty Howell 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 Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- 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 -w ./task-depends.dot + +To find out what a package depends on: + %(prog)s -k -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)