summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-27 11:49:20 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-27 11:49:20 -0700
commit985ddf279d8a26a848ddbc3d10a9a77b16d3af22 (patch)
tree718c137061395e4856a3c2e36b81298339ed078b /pym
parent310da49821ea455a88ac55e3901fb6f9fcb79e21 (diff)
downloadportage-985ddf279d8a26a848ddbc3d10a9a77b16d3af22.tar.gz
portage-985ddf279d8a26a848ddbc3d10a9a77b16d3af22.tar.bz2
portage-985ddf279d8a26a848ddbc3d10a9a77b16d3af22.zip
LocationsManager._addProfile: realpath parents
If it seems that a parent may point outside of the current repo, realpath it.
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/package/ebuild/_config/LocationsManager.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pym/portage/package/ebuild/_config/LocationsManager.py b/pym/portage/package/ebuild/_config/LocationsManager.py
index debabed2b..0ab0950ef 100644
--- a/pym/portage/package/ebuild/_config/LocationsManager.py
+++ b/pym/portage/package/ebuild/_config/LocationsManager.py
@@ -108,6 +108,7 @@ class LocationsManager(object):
def _addProfile(self, currentPath, known_repos):
current_abs_path = os.path.abspath(currentPath)
allow_directories = True
+ repo_loc = None
compat_mode = False
intersecting_repos = [x for x in known_repos if current_abs_path.startswith(x[0])]
if intersecting_repos:
@@ -158,8 +159,16 @@ class LocationsManager(object):
raise ParseError(
_("Empty parent file: '%s'") % parentsFile)
for parentPath in parents:
+ abs_parent = parentPath[:1] == os.sep
parentPath = normalize_path(os.path.join(
currentPath, parentPath))
+
+ if abs_parent or repo_loc is None or \
+ not parentPath.startswith(repo_loc):
+ # It seems that this parent may point outside
+ # of the current repo, so realpath it.
+ parentPath = os.path.realpath(parentPath)
+
if os.path.exists(parentPath):
self._addProfile(parentPath, known_repos)
else: