Filter empty elements in cumulative env-update variables. Thanks to Brian Harring...
authorZac Medico <zmedico@gentoo.org>
Tue, 17 Oct 2006 20:46:56 +0000 (20:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 17 Oct 2006 20:46:56 +0000 (20:46 -0000)
svn path=/main/trunk/; revision=4741

pym/portage.py

index 082b98c78b2b0ea7fce2fa3d04be25c3b9cbd9a4..c505073688605609b3a5fd4239328b93c8977b8a 100644 (file)
@@ -593,7 +593,7 @@ 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(myconfig[var].split())
+                               mylist.extend(filter(None, myconfig[var].split()))
                                del myconfig[var] # prepare for env.update(myconfig)
                if mylist:
                        env[var] = " ".join(mylist)
@@ -603,7 +603,7 @@ 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(myconfig[var].split(":"))
+                               mylist.extend(filter(None, myconfig[var].split(":")))
                                del myconfig[var] # prepare for env.update(myconfig)
                if mylist:
                        env[var] = ":".join(mylist)