If 2 make.conf files found, then warn.
authorZac Medico <zmedico@gentoo.org>
Mon, 7 Jan 2013 07:11:28 +0000 (23:11 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 7 Jan 2013 08:40:43 +0000 (00:40 -0800)
This may give a clue to those who unintentionally end up with 2
make.conf files somehow.

pym/portage/package/ebuild/config.py

index 3875b576e56ddc8dc17ed83a0e011cd11fad7113..7bb85b36cba51da01e6699c1dec258b6faf389b9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010-2012 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = [
@@ -330,11 +330,20 @@ class config(object):
                        except OSError:
                                pass
 
+                       make_conf_count = 0
                        make_conf = {}
                        for x in make_conf_paths:
-                               make_conf.update(getconfig(x,
+                               mygcfg = getconfig(x,
                                        tolerant=tolerant, allow_sourcing=True,
-                                       expand=make_conf) or {})
+                                       expand=make_conf)
+                               if mygcfg is not None:
+                                       make_conf.update(mygcfg)
+                                       make_conf_count += 1
+
+                       if make_conf_count == 2:
+                               writemsg("!!! %s\n" %
+                                       _("Found 2 make.conf files, using both '%s' and '%s'") %
+                                       tuple(make_conf_paths), noiselevel=-1)
 
                        # Allow ROOT setting to come from make.conf if it's not overridden
                        # by the constructor argument (from the calling environment).