Add support for /etc/portage/make.conf. If present, this file will
authorZac Medico <zmedico@gentoo.org>
Mon, 16 Aug 2010 01:54:48 +0000 (18:54 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 16 Aug 2010 01:54:48 +0000 (18:54 -0700)
override settings from /etc/make.conf.

man/make.conf.5
man/portage.5
pym/portage/package/ebuild/config.py

index d110b3acd6d60a876c1ea312716499cc7a7398fb..540a15e4baf1b98e8fc37291bbd6ff22a2493670 100644 (file)
@@ -2,7 +2,7 @@
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
-.B /etc/make.conf
+\fB/etc/make.conf\fR and \fB/etc/portage/make.conf\fR
 .SH "DESCRIPTION"
 This file contains various variables that are used by Portage.
 Portage will check the currently\-defined environment variables
@@ -809,7 +809,7 @@ Saleem Abdulrasool <compnerd@gentoo.org>
 .fi
 .SH "FILES"
 .TP
-.B /etc/make.conf
+\fB/etc/make.conf\fR and \fB/etc/portage/make.conf\fR
 Contains variables for the build\-process and overwrites those in make.defaults.
 .TP
 .B /etc/make.globals
index c3e8d8655baf9b4ae2263ca2de6f54998dec6cda..d13eee5245573bd47bad7013ce8b99b27a02f27e 100644 (file)
@@ -48,6 +48,7 @@ virtuals
 bashrc
 categories
 color.map
+make.conf
 mirrors
 modules
 package.keywords
@@ -437,6 +438,10 @@ media\-other
 .BR color.map
 Contains variables customizing colors. See \fBcolor.map\fR(5).
 .TP
+.BR make.conf
+The global custom settings for Portage. See \fBmake.conf\fR(5).
+If present, this file will override settings from /etc/make.conf.
+.TP
 .BR mirrors
 Whenever portage encounters a mirror:// style URI it will look up the actual 
 hosts here.  If the mirror set is not found here, it will check the global 
index cdfbdc28a4f8e1061c31af7580123f1bf010209a..d01f7aeab98f0fb96aaacab4866ac9d34b2a60cd 100644 (file)
@@ -447,6 +447,7 @@ class config(object):
                                config_root)).rstrip(os.path.sep) + os.path.sep
 
                        check_var_directory("PORTAGE_CONFIGROOT", config_root)
+                       abs_user_config = os.path.join(config_root, USER_CONFIG_PATH)
 
                        self.depcachedir = DEPCACHE_PATH
 
@@ -619,8 +620,11 @@ class config(object):
                        make_conf = getconfig(
                                os.path.join(config_root, MAKE_CONF_FILE),
                                tolerant=tolerant, allow_sourcing=True)
-                       if make_conf is None:
-                               make_conf = {}
+
+                       make_conf.update(getconfig(
+                               os.path.join(abs_user_config, 'make.conf'),
+                               tolerant=tolerant, allow_sourcing=True,
+                               expand=make_conf))
 
                        # Allow ROOT setting to come from make.conf if it's not overridden
                        # by the constructor argument (from the calling environment).
@@ -723,8 +727,10 @@ class config(object):
                        self.mygcfg = getconfig(
                                os.path.join(config_root, MAKE_CONF_FILE),
                                tolerant=tolerant, allow_sourcing=True, expand=expand_map)
-                       if self.mygcfg is None:
-                               self.mygcfg = {}
+
+                       self.mygcfg.update(getconfig(
+                               os.path.join(abs_user_config, 'make.conf'),
+                               tolerant=tolerant, allow_sourcing=True, expand=expand_map))
 
                        # Don't allow the user to override certain variables in make.conf
                        profile_only_variables = self.configdict["defaults"].get(
@@ -778,7 +784,6 @@ class config(object):
                        self._plicensedict = portage.dep.ExtendedAtomDict(dict)
                        self._ppropertiesdict = portage.dep.ExtendedAtomDict(dict)
                        self.punmaskdict = portage.dep.ExtendedAtomDict(list)
-                       abs_user_config = os.path.join(config_root, USER_CONFIG_PATH)
 
                        # locations for "categories" and "arch.list" files
                        locations = [os.path.join(self["PORTDIR"], "profiles")]