From: Thomas Perale via buildroot <buildroot@buildroot.org>
To: Nevo Hed <nhed+buildroot@starry.com>
Cc: Thomas Perale <thomas.perale@mind.be>,
buildroot@buildroot.org, Nevo Hed <nhed+github@starry.com>
Subject: Re: [Buildroot] [PATCH] utils/generate-cyclonedx: fix monotonically increasing dependency list
Date: Tue, 7 Oct 2025 22:07:40 +0200 [thread overview]
Message-ID: <20251007200740.152121-1-thomas.perale@mind.be> (raw)
In-Reply-To: <20251007174036.1178955-1-nhed+buildroot@starry.com>
In reply of:
> Having mutables as default args has unexpected behaviors.
> br2_parse_deps_recursively had a default arg `deps` initialized to the
> empty list (`[]`) except that on subsequent calls from `main` deps would
> already be populated from prior components.
Hi, thanks for the bug fix !
Reviewed-by: Thomas Perale <thomas.perale@mind.be>
> ---
> utils/generate-cyclonedx | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/utils/generate-cyclonedx b/utils/generate-cyclonedx
> index 60983ac1ea..7d3ef57ab3 100755
> --- a/utils/generate-cyclonedx
> +++ b/utils/generate-cyclonedx
> @@ -238,7 +238,7 @@ def cyclonedx_vulnerabilities(show_info_dict):
> } for cve, components in cves.items()]
>
>
> -def br2_parse_deps_recursively(ref, show_info_dict, virtual=False, deps=[]):
> +def br2_parse_deps_recursively(ref, show_info_dict, virtual=False, deps=None):
> """Parse dependencies from the show-info output. This function will
> recursively collect all dependencies, and return a list where each dependency
> is stated at most once.
> @@ -258,6 +258,8 @@ def br2_parse_deps_recursively(ref, show_info_dict, virtual=False, deps=[]):
> Returns:
> list: A list of dependencies of the 'ref' package.
> """
> + if deps is None:
> + deps = []
> for dep in show_info_dict.get(ref, {}).get("dependencies", []):
> if dep not in deps:
> if virtual or show_info_dict.get(dep, {}).get("virtual") is False:
> --
> 2.51.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2025-10-07 20:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 17:40 [Buildroot] [PATCH] utils/generate-cyclonedx: fix monotonically increasing dependency list Nevo Hed via buildroot
2025-10-07 19:31 ` Nevo Hed via buildroot
2025-10-07 20:07 ` Thomas Perale via buildroot [this message]
2025-11-20 22:32 ` Thomas Petazzoni via buildroot
2025-12-02 21:34 ` Nevo Hed via buildroot
2025-12-03 7:46 ` Thomas Petazzoni via buildroot
[not found] ` <20251226041452.1040838-1-nhed+github@starry.com>
[not found] ` <20251226041452.1040838-2-nhed+github@starry.com>
2025-12-26 19:55 ` [Buildroot] [PATCH v2 1/1] " Nevo Hed 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=20251007200740.152121-1-thomas.perale@mind.be \
--to=buildroot@buildroot.org \
--cc=nhed+buildroot@starry.com \
--cc=nhed+github@starry.com \
--cc=thomas.perale@mind.be \
/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