summaryrefslogtreecommitdiffstats
path: root/pym/portage/package/ebuild/config.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-05-15 21:54:58 -0700
committerZac Medico <zmedico@gentoo.org>2012-05-15 21:54:58 -0700
commitb73cac4bb004da49b8d2075f06529a8c4e5269db (patch)
treeddd9df9505c83da1a873df3919c66632f8e839a9 /pym/portage/package/ebuild/config.py
parentaa109884a0168656c3548cc90ca5a4854f3928c2 (diff)
downloadportage-b73cac4bb004da49b8d2075f06529a8c4e5269db.tar.gz
portage-b73cac4bb004da49b8d2075f06529a8c4e5269db.tar.bz2
portage-b73cac4bb004da49b8d2075f06529a8c4e5269db.zip
config: fix /etc/portage/make.profile error msg
Diffstat (limited to 'pym/portage/package/ebuild/config.py')
-rw-r--r--pym/portage/package/ebuild/config.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index aa4a62ea2..97cbd9960 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -919,11 +919,26 @@ class config(object):
writemsg(_("!!! INVALID ACCEPT_KEYWORDS: %s\n") % str(group),
noiselevel=-1)
- abs_profile_path = os.path.join(self["PORTAGE_CONFIGROOT"],
- PROFILE_PATH)
- if (not self.profile_path or \
- not os.path.exists(os.path.join(self.profile_path, "parent"))) and \
- os.path.exists(os.path.join(self["PORTDIR"], "profiles")):
+ profile_broken = not self.profile_path or \
+ not os.path.exists(os.path.join(self.profile_path, "parent")) and \
+ os.path.exists(os.path.join(self["PORTDIR"], "profiles"))
+
+ if profile_broken:
+ abs_profile_path = None
+ for x in (PROFILE_PATH, 'etc/portage/make.profile'):
+ x = os.path.join(self["PORTAGE_CONFIGROOT"], x)
+ try:
+ os.lstat(x)
+ except OSError:
+ pass
+ else:
+ abs_profile_path = x
+ break
+
+ if abs_profile_path is None:
+ abs_profile_path = os.path.join(self["PORTAGE_CONFIGROOT"],
+ PROFILE_PATH)
+
writemsg(_("\n\n!!! %s is not a symlink and will probably prevent most merges.\n") % abs_profile_path,
noiselevel=-1)
writemsg(_("!!! It should point into a profile within %s/profiles/\n") % self["PORTDIR"])