From patchwork Sat Jul 8 15:55:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 27096 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 A3E60C001E0 for ; Sat, 8 Jul 2023 15:56:17 +0000 (UTC) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web10.337.1688831771665086338 for ; Sat, 08 Jul 2023 08:56:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20221208.gappssmtp.com header.s=20221208 header.b=OY228a3s; spf=softfail (domain: sakoman.com, ip: 209.85.216.52, mailfrom: steve@sakoman.com) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-262d9e75438so2136636a91.2 for ; Sat, 08 Jul 2023 08:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20221208.gappssmtp.com; s=20221208; t=1688831771; x=1691423771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jW75ezQsxhrtvA1jS2bv79tNC48t6Dl8jIUQGgXvDR8=; b=OY228a3s4A2Z9SNHxc3BR5Q/rcXajIfFXpHesF0Ot8hX4ZPgBXTOQKqeJw/eOKvQI9 HMstloKwm0hPrd482UdeelTNbr0fAeMmlI3usWCGTrv0cD8BEQrQauuvlHc2r0XRppBk K3C0EfAwc7VCV1oMB9MVw+KYTuO4p8hw/u9tBfXFMJk9DILhU2moJumUQcqn4Ir439ez rbnpAN2Vu7cZyV2hcdKvw4Vl9wnUDjW3kCN/Ze0nJvZLKzrAeWX8HEzEiu0+jBeZZVJi E2jZmltUGOm4ipytcfNygSqPoHRYiIF+vkvKGrI7th/4OzZCwrEY0V3JGeJAQzNOeElZ VGzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688831771; x=1691423771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jW75ezQsxhrtvA1jS2bv79tNC48t6Dl8jIUQGgXvDR8=; b=JV0BJ1frKdc0cqEMp6GbxSDgGkKgNkDJZr2tfn0Q24a4sLVfqheFzU9cD+o4bmnkdE fNYD3jPpNDA9uqrHs1MHoI2HGQRBYt+AQ7YAV0cx17xsjSufcHS5ENFd+vkzea+D8ZGw JvcPmevy8DBNIJHxLDGJ8QGWkegtcyIsfcGa3OKlC39iK4RBXOYJg748hmVsFCZjrYv8 ofVUn5Y+It+osw4iu690Hbi9fV3vmEDqZodhCsF01Ruhs0sU81dETtNyQ46JsXrBV9oD Iaqrth7JHJVqshYLdStLfmpsSWqHlAvHaE8Bqo19WYKi+5ju7iurz9hsLTguXkebSJ/x HTeQ== X-Gm-Message-State: ABy/qLafrf/rmTRRy25zAlXWItYK2gdUn2JefA3M0FQImTE7EKRcLpfW jT9gdN6wm2w7oKiXkVNduV7dsJt7pDcbXg1ig7k= X-Google-Smtp-Source: APBJJlHp7Pkg2ZPCGEegx34yTOZyDE7XWAkGrKWoOsTgQzS9QpSKkbAOvu1aiwBdfmruQ/PwqgJ7kA== X-Received: by 2002:a17:90a:8804:b0:25b:be3a:e6ae with SMTP id s4-20020a17090a880400b0025bbe3ae6aemr7899174pjn.18.1688831770637; Sat, 08 Jul 2023 08:56:10 -0700 (PDT) Received: from hexa.lan (dhcp-72-234-106-30.hawaiiantel.net. [72.234.106.30]) by smtp.gmail.com with ESMTPSA id u14-20020a17090a410e00b00263f6687690sm3257801pjf.18.2023.07.08.08.56.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jul 2023 08:56:10 -0700 (PDT) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][dunfell 06/17] oe-depends-dot: Handle new format for task-depends.dot Date: Sat, 8 Jul 2023 05:55:40 -1000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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 ; Sat, 08 Jul 2023 15:56:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/184026 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 Signed-off-by: Steve Sakoman --- 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)