[elbe-devel] [PATCH v1 1/2] commands: show: fix pkg-list handling

Bastian Germann bage at linutronix.de
Mon Jul 11 19:10:06 CEST 2022


Am 10.07.22 um 10:35 schrieb Holger Dengler:
> The <pkg-list> node is optional, so skip the pkg-list output, if the
> node is not there.
> 
> Signed-off-by: Holger Dengler <holger at hdengler.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>   elbepack/commands/show.py | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/elbepack/commands/show.py b/elbepack/commands/show.py
> index 5d5df3e16..bd00c11e6 100644
> --- a/elbepack/commands/show.py
> +++ b/elbepack/commands/show.py
> @@ -74,8 +74,9 @@ def run_command(argv):
>                       print("    deb %s" % url.text("binary").strip())
>                   if url.has("source"):
>                       print("    deb-src %s" % url.text("source").strip())
> -        print("packages:")
> -        for pkg in xml.node("./target/pkg-list"):
> -            print("    %s" % pkg.et.text)
> +        if xml.has("./target/pkg-list"):
> +            print("packages:")
> +            for pkg in xml.node("./target/pkg-list"):
> +                print("    %s" % pkg.et.text)
>           print("skip package validation: %s" % xml.has("./project/noauth"))
>           print("archive embedded?        %s" % xml.has("./archive"))


More information about the elbe-devel mailing list