Grab make.globals from GLOBAL_CONFIG_PATH if available and fall back to the
authorZac Medico <zmedico@gentoo.org>
Thu, 9 Oct 2008 23:29:54 +0000 (23:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 9 Oct 2008 23:29:54 +0000 (23:29 -0000)
legacy location if necessary.

svn path=/main/trunk/; revision=11669

pym/portage/__init__.py

index 8e67447822c7d87dbf6284c8dcf40b16600f82f0..38724fc454a7cbf618cf80f2961da291fbc0f34a 100644 (file)
@@ -1343,8 +1343,11 @@ class config(object):
 
                        # make.globals should not be relative to config_root
                        # because it only contains constants.
-                       self.mygcfg = getconfig(os.path.join("/etc", "make.globals"),
-                               expand=expand_map)
+                       for x in (portage.const.GLOBAL_CONFIG_PATH, "/etc"):
+                               self.mygcfg = getconfig(os.path.join(x, "make.globals"),
+                                       expand=expand_map)
+                               if self.mygcfg:
+                                       break
 
                        if self.mygcfg is None:
                                self.mygcfg = {}