[libvirt PATCH 07/11] ci: helper: Improve output for list-images action

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This makes the output more compact by grouping together all
images that are built on the same base OS.

Later on, when we change the actions that operate on
container images to accept an lcitool-style --cross-arch
argument instead of expecting the name of the image to have
the cross-building architecture baked in, this will allow
users to quickly copy-and-paste the necessary information.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 ci/helper | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/ci/helper b/ci/helper
index c1e1a53d51..6543a47131 100755
--- a/ci/helper
+++ b/ci/helper
@@ -311,25 +311,12 @@ class Application:
                                              self._args.gitlab_uri)
         images = util.get_registry_images(registry_uri)
 
-        native = []
-        cross = []
-        for image_distro in images.keys():
-            if images[image_distro]:
-                for image_cross in images[image_distro]:
-                    cross.append(image_distro + "-cross-" + image_cross)
+        for distro in sorted(images.keys()):
+            if images[distro]:
+                cross = " ".join(sorted(images[distro]))
+                print(f"{distro} (cross: {cross})")
             else:
-                native.append(image_distro)
-        native.sort()
-        cross.sort()
-
-        spacing = 4 * " "
-        print("Available x86 container images:\n")
-        print(spacing + ("\n" + spacing).join(native))
-
-        if cross:
-            print()
-            print("Available cross-compiler container images:\n")
-            print(spacing + ("\n" + spacing).join(cross))
+                print(distro)
 
     def _action_refresh(self):
         self._refresh_containers()
-- 
2.26.3




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux