Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Steve Hay <me@stevenhay.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] support/scripts/graph-depends cleanup done_deps global
Date: Mon, 23 Jan 2023 08:01:33 +0100	[thread overview]
Message-ID: <20230123070133.GB2632@scaer> (raw)
In-Reply-To: <20230122234309.2111129-1-me@stevenhay.com>

Steve, All,

Thanks for this patch, here a quick review.

On 2023-01-23 00:43 +0100, Steve Hay via buildroot spake thusly:
> From: Steve <me@stevenhay.com>

Please use you full name as author (not just your first name).

Please provide a (potentially terse) explanation for the change.

> Signed-off-by: Steve Hay <me@stevenhay.com>
> ---
>  support/scripts/graph-depends | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
> index a66fb28f41..3e3373950f 100755
> --- a/support/scripts/graph-depends
> +++ b/support/scripts/graph-depends
> @@ -197,12 +197,11 @@ def print_attrs(outfile, pkg, pkg_type, pkg_version, depth, colors):
>      outfile.write("%s [color=%s,style=filled]\n" % (name, color))
>  
>  
> -done_deps = []
> -
> -
>  # Print the dependency graph of a package
>  def print_pkg_deps(outfile, dict_deps, dict_types, dict_versions, stop_list, exclude_list,
> -                   arrow_dir, draw_graph, depth, max_depth, pkg, colors):
> +                   arrow_dir, draw_graph, depth, max_depth, pkg, colors, done_deps=None):

Make the default be the empty list:  done_deps=[]

> +    if done_deps is None:
> +        done_deps = []

... which allows to drop this conditional.

I was wondering how that could work, as the list is now a parameter,
but the list is not passed as a copy, it is passed as a "reference"
in python... So yes, it works (the .dot are the same before/after).

Regards,
Yann E. MORIN.

>      if pkg in done_deps:
>          return
>      done_deps.append(pkg)
> @@ -234,7 +233,7 @@ def print_pkg_deps(outfile, dict_deps, dict_types, dict_versions, stop_list, exc
>                  if draw_graph:
>                      outfile.write("%s -> %s [dir=%s]\n" % (pkg_node_name(pkg), pkg_node_name(d), arrow_dir))
>                  print_pkg_deps(outfile, dict_deps, dict_types, dict_versions, stop_list, exclude_list,
> -                               arrow_dir, draw_graph, depth + 1, max_depth, d, colors)
> +                               arrow_dir, draw_graph, depth + 1, max_depth, d, colors, done_deps)
>  
>  
>  def parse_args():
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-01-23  7:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-22 23:43 [Buildroot] [PATCH 1/2] support/scripts/graph-depends cleanup done_deps global Steve Hay via buildroot
2023-01-22 23:43 ` [Buildroot] [PATCH 2/2] support/scripts/graph-depends allow for forward and reverse depends on same graph Steve Hay via buildroot
2023-01-23  7:20   ` Yann E. MORIN
2023-01-23 23:06     ` ʎɐH ǝʌǝʇS via buildroot
2023-01-23  7:01 ` Yann E. MORIN [this message]
     [not found]   ` <f1b4fdfa-786f-2b09-5396-33ad4e79b64f@stevenhay.com>
2023-01-23 20:15     ` [Buildroot] [PATCH 1/2] support/scripts/graph-depends cleanup done_deps global ʎɐH ǝʌǝʇS via buildroot
  -- strict thread matches above, loose matches on Subject: below --
2023-01-23 20:32 Steve Hay via buildroot

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=20230123070133.GB2632@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=me@stevenhay.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox