[PATCH 10/10] Avoid duplicates in the packages property.

Chris Lumens clumens at redhat.com
Tue Aug 28 18:54:05 UTC 2012


This isn't critical.  It just looks a little silly in a traceback and probably
slows things down a little bit when we keep trying to select the same package
over and over again later.
---
 pyanaconda/storage/__init__.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index c200933..0ef1349 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1604,18 +1604,18 @@ class Storage(object):
 
     @property
     def packages(self):
-        pkgs = []
+        pkgs = set()
         if self.platform:
-            pkgs.extend(self.platform.packages)
+            pkgs.update(self.platform.packages)
 
         if self.bootloader:
-            pkgs.extend(self.bootloader.packages)
+            pkgs.update(self.bootloader.packages)
 
         for device in self.fsset.devices:
             # this takes care of device and filesystem packages
-            pkgs.extend(device.packages)
+            pkgs.update(device.packages)
 
-        return pkgs
+        return list(pkgs)
 
     def write(self):
         if not os.path.isdir("%s/etc" % ROOT_PATH):
-- 
1.7.11.2



More information about the anaconda-patches mailing list