[libvirt] [jenkins-ci PATCH v3 08/10] lcitool: refactor logic for building package list

Daniel P. Berrangé berrange at redhat.com
Wed Feb 13 19:03:03 UTC 2019


Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 guests/lcitool | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 1271954..0978c40 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -529,15 +529,18 @@ class Application:
                 if os_full in mappings[package]:
                     temp[package] = mappings[package][os_full]
 
-        flattened = []
+        pkgs = []
         for item in temp:
-            if temp[item] is not None and temp[item] not in flattened:
-                flattened += [temp[item]]
+            pkgname = temp[item]
+            if pkgname is None:
+                continue
+            if pkgname not in pkgs:
+                pkgs.append(pkgname)
 
         print("FROM {}".format(facts["docker_base"]))
 
         sys.stdout.write("ENV PACKAGES ")
-        sys.stdout.write(" \\\n             ".join(sorted(flattened)))
+        sys.stdout.write(" \\\n             ".join(sorted(pkgs)))
 
         if package_format == "deb":
             sys.stdout.write(textwrap.dedent("""
-- 
2.20.1




More information about the libvir-list mailing list