From 61215c22e0f9b9ebf2f9ae09c23a4663febaf5b0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 15 Jan 2013 07:02:59 -0800 Subject: Warn if 2 make.profile dirs found, bug #452176 --- pym/portage/package/ebuild/_config/LocationsManager.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'pym') 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: -- cgit v1.2.3-1-g7c22