[elbe-devel] [PATCH 1/8] elbepack: cyclonedx-sbom: simplify duplicate check

Eduard Krein eduard.krein at linutronix.de
Fri Aug 30 09:15:22 CEST 2024


Am Freitag, dem 30.08.2024 um 09:10 +0200 schrieb Thomas Weißschuh:
> There is no reason to build the JSON twice and throw one of it away.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
For the whole Series:
Reviewed-by: Eduard Krein <eduard.krein at linutronix.de>
> ---
>  elbepack/commands/cyclonedx-sbom.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/commands/cyclonedx-sbom.py
> b/elbepack/commands/cyclonedx-sbom.py
> index d0996ebbf1b1..8b2809b673c3 100644
> --- a/elbepack/commands/cyclonedx-sbom.py
> +++ b/elbepack/commands/cyclonedx-sbom.py
> @@ -111,8 +111,9 @@ def run_command(argv):
>          source_file.node('initvmpkgs'),
>      ):
>          # Duplicates are disallowed by the schema
> -        if _component_from_apt_pkg(XMLPackage(p)) not in
> formulation_components:
> -           
> formulation_components.append(_component_from_apt_pkg(XMLPackage(p)))
> +        c = _component_from_apt_pkg(XMLPackage(p))
> +        if c not in formulation_components:
> +            formulation_components.append(c)
>  
>      output = {
>          'bomFormat': 'CycloneDX',

-- 
Eduard Krein
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 19; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/legal/data-protection.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br.,
HRB700 806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas
Gleixner, Tiffany Silva, Sean Fennelly, Jeffrey Schneiderman






More information about the elbe-devel mailing list