From 48479b4a3dd62085d1c746b7a807a39b1c6538f3 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 6 Jan 2013 23:11:28 -0800 Subject: If 2 make.conf files found, then warn. This may give a clue to those who unintentionally end up with 2 make.conf files somehow. --- pym/portage/package/ebuild/config.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'pym/portage') diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 3875b576e..7bb85b36c 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -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). -- cgit v1.2.3-1-g7c22