summaryrefslogtreecommitdiffstats
path: root/pym/portage/package/ebuild/config.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-24 13:53:04 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-24 13:53:04 -0800
commit082d3ef7ff047e40873e03f0b068a2942dda3fc1 (patch)
treed56e6a0d73aa6f3227bb1dcca37f80862b40e827 /pym/portage/package/ebuild/config.py
parenteac9deb5f2a11997cc012856a235575f658d6d7a (diff)
downloadportage-082d3ef7ff047e40873e03f0b068a2942dda3fc1.tar.gz
portage-082d3ef7ff047e40873e03f0b068a2942dda3fc1.tar.bz2
portage-082d3ef7ff047e40873e03f0b068a2942dda3fc1.zip
config: raise PermissionDenied morev2.2.0_alpha161
This enables clear reporting of "Permission Denied" when appropriate, instead of triggering nonsensical messages about invalid profiles or repositories.
Diffstat (limited to 'pym/portage/package/ebuild/config.py')
-rw-r--r--pym/portage/package/ebuild/config.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 0ea0841b2..352b2982a 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -46,6 +46,7 @@ from portage.util import ensure_dirs, getconfig, grabdict, \
grabdict_package, grabfile, grabfile_package, LazyItemsDict, \
normalize_path, shlex_split, stack_dictlist, stack_dicts, stack_lists, \
writemsg, writemsg_level, _eapi_cache
+from portage.util._path import exists_raise_eaccess, isdir_raise_eaccess
from portage.versions import catpkgsplit, catsplit, cpv_getkey, _pkg_str
from portage.package.ebuild._config import special_env_vars
@@ -620,7 +621,7 @@ class config(object):
shell_quote_re = re.compile(r"[\s\\\"'$`]")
for ov in portdir_overlay:
ov = normalize_path(ov)
- if os.path.isdir(ov):
+ if isdir_raise_eaccess(ov):
if shell_quote_re.search(ov) is not None:
ov = portage._shell_quote(ov)
new_ov.append(ov)
@@ -1006,8 +1007,8 @@ class config(object):
noiselevel=-1)
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"))
+ not exists_raise_eaccess(os.path.join(self.profile_path, "parent")) and \
+ exists_raise_eaccess(os.path.join(self["PORTDIR"], "profiles"))
if profile_broken:
abs_profile_path = None