Remove duplicate entries from special variables processed by env_update() (bug #172194)
authorMarius Mauch <genone@gentoo.org>
Tue, 5 Jun 2007 17:55:03 +0000 (17:55 -0000)
committerMarius Mauch <genone@gentoo.org>
Tue, 5 Jun 2007 17:55:03 +0000 (17:55 -0000)
svn path=/main/trunk/; revision=6736

pym/portage/__init__.py

index 5417a5c8c7c4cb57e53c6fdb0743d0ea0a4d3e33..89f4a1f4ef60c199cdd63a0ea1a38094578907a6 100644 (file)
@@ -517,7 +517,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)
@@ -527,7 +529,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)