summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-15 07:02:59 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-15 07:02:59 -0800
commit61215c22e0f9b9ebf2f9ae09c23a4663febaf5b0 (patch)
tree1c5c7d5d46384ea0c8fe68860a03f7ce9bf236c9
parent70bfb6b8ebdb74fe5fbe244532e35f86cab9742e (diff)
downloadportage-61215c22e0f9b9ebf2f9ae09c23a4663febaf5b0.tar.gz
portage-61215c22e0f9b9ebf2f9ae09c23a4663febaf5b0.tar.bz2
portage-61215c22e0f9b9ebf2f9ae09c23a4663febaf5b0.zip
Warn if 2 make.profile dirs found, bug #452176
-rw-r--r--pym/portage/package/ebuild/_config/LocationsManager.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/pym/portage/package/ebuild/_config/LocationsManager.py b/pym/portage/package/ebuild/_config/LocationsManager.py
index 1ca2b324d..8f88e4909 100644
--- a/pym/portage/package/ebuild/_config/LocationsManager.py
+++ b/pym/portage/package/ebuild/_config/LocationsManager.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__ = (
@@ -73,13 +73,25 @@ class LocationsManager(object):
known_repos = tuple(known_repos)
if self.config_profile_path is None:
+ deprecated_profile_path = os.path.join(
+ self.config_root, 'etc', 'make.profile')
self.config_profile_path = \
os.path.join(self.config_root, PROFILE_PATH)
if os.path.isdir(self.config_profile_path):
self.profile_path = self.config_profile_path
+ if os.path.isdir(deprecated_profile_path) and not \
+ os.path.samefile(self.profile_path,
+ deprecated_profile_path):
+ # 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 2 make.profile dirs: "
+ "using '%s', ignoring '%s'") %
+ (self.profile_path, deprecated_profile_path),
+ noiselevel=-1)
else:
- self.config_profile_path = \
- os.path.join(self.config_root, 'etc', 'make.profile')
+ self.config_profile_path = deprecated_profile_path
if os.path.isdir(self.config_profile_path):
self.profile_path = self.config_profile_path
else: