summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-09 04:24:16 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-09 04:24:16 +0000
commit2160424429015b1e507b83b8bdee19d1b000a812 (patch)
tree538f790a88d275928a99bad4ef53ddbf5c72977e
parent26e2e9c2a7c6bf8f4056caa8fbde27908bf6a331 (diff)
downloadportage-2160424429015b1e507b83b8bdee19d1b000a812.tar.gz
portage-2160424429015b1e507b83b8bdee19d1b000a812.tar.bz2
portage-2160424429015b1e507b83b8bdee19d1b000a812.zip
Add support for displaying profile listed in make.profile/parent when
make.profile is not a symlink. The first parent with a path inside $PORTDIR is displayed. svn path=/main/trunk/; revision=15787
-rw-r--r--pym/_emerge/actions.py37
1 files changed, 28 insertions, 9 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 9b5931181..bf26881bf 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2429,19 +2429,38 @@ def display_missing_pkg_set(root_config, set_name):
writemsg_level("".join("%s\n" % l for l in msg),
level=logging.ERROR, noiselevel=-1)
+def relative_profile_path(portdir, abs_profile):
+ realpath = os.path.realpath(abs_profile)
+ basepath = os.path.realpath(os.path.join(portdir, "profiles"))
+ if realpath.startswith(basepath):
+ profilever = realpath[1 + len(basepath):]
+ else:
+ profilever = None
+ return profilever
+
def getportageversion(portdir, target_root, profile, chost, vardb):
- profilever = "unavailable"
+ profilever = None
if profile:
- realpath = os.path.realpath(profile)
- basepath = os.path.realpath(os.path.join(portdir, "profiles"))
- if realpath.startswith(basepath):
- profilever = realpath[1 + len(basepath):]
- else:
+ profilever = relative_profile_path(portdir, profile)
+ if profilever is None:
try:
- profilever = "!" + os.readlink(profile)
- except (OSError):
+ for parent in portage.grabfile(
+ os.path.join(profile, 'parent')):
+ profilever = relative_profile_path(portdir,
+ os.path.join(profile, parent))
+ if profilever is not None:
+ break
+ except portage.exception.PortageException:
pass
- del realpath, basepath
+
+ if profilever is None:
+ try:
+ profilever = "!" + os.readlink(profile)
+ except (OSError):
+ pass
+
+ if profilever is None:
+ profilever = "unavailable"
libcver=[]
libclist = vardb.match("virtual/libc")