aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-15 15:16:02 (GMT)
committerZac Medico <zmedico@gentoo.org>2013-01-15 15:16:02 (GMT)
commit7c624515d0bb106c8a468addff5df153cebf31fc (patch)
treec9c339f029dfaa30fa836333ab8acfa131873ee8
parentWarn if 2 make.profile dirs found, bug #452176 (diff)
downloadportage-7c624515d0bb106c8a468addff5df153cebf31fc.zip
portage-7c624515d0bb106c8a468addff5df153cebf31fc.tar.gz
portage-7c624515d0bb106c8a468addff5df153cebf31fc.tar.bz2
Warn if old make.globals found, bug #452176v2.2.0_alpha153
-rw-r--r--pym/portage/package/ebuild/config.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 7bb85b3..1364a3d 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -376,8 +376,22 @@ class config(object):
# Allow make.globals to set default paths relative to ${EPREFIX}.
expand_map["EPREFIX"] = eprefix
- make_globals = getconfig(os.path.join(
- self.global_config_path, 'make.globals'),
+ make_globals_path = os.path.join(
+ self.global_config_path, 'make.globals')
+ old_make_globals = os.path.join(config_root,
+ 'etc', 'make.globals')
+ if os.path.isfile(old_make_globals) and \
+ not os.path.samefile(make_globals_path, old_make_globals):
+ # Don't warn if they refer to the same path, since
+ # that can be used for backward compatibility with
+ # old software.
+ writemsg("!!! %s\n" %
+ _("Found obsolete make.globals file: "
+ "'%s', (using '%s' instead)") %
+ (old_make_globals, make_globals_path),
+ noiselevel=-1)
+
+ make_globals = getconfig(make_globals_path,
tolerant=tolerant, expand=expand_map)
if make_globals is None:
make_globals = {}