Remove duplicate entries from special variables processed by env_update() (bug #17219...
authorZac Medico <zmedico@gentoo.org>
Fri, 8 Jun 2007 19:25:54 +0000 (19:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 8 Jun 2007 19:25:54 +0000 (19:25 -0000)
svn path=/main/branches/2.1.2/; revision=6757

pym/portage.py

index 8e8f87b7aebd2ac6e13ec5ea869edb5280417a40..05283f3ffb6d810234b0fb735e1dc2276221ba6a 100644 (file)
@@ -595,7 +595,9 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None):
                mylist = []
                for myconfig in config_list:
                        if var in myconfig:
-                               mylist.extend(filter(None, myconfig[var].split()))
+                               for item in myconfig[var].split(""):
+                                       if item and not item in mylist:
+                                               mylist.append(item)
                                del myconfig[var] # prepare for env.update(myconfig)
                if mylist:
                        env[var] = " ".join(mylist)
@@ -605,7 +607,9 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None):
                mylist = []
                for myconfig in config_list:
                        if var in myconfig:
-                               mylist.extend(filter(None, myconfig[var].split(":")))
+                               for item in myconfig[var].split(":"):
+                                       if item and not item in mylist:
+                                               mylist.append(item)
                                del myconfig[var] # prepare for env.update(myconfig)
                if mylist:
                        env[var] = ":".join(mylist)