summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-30 20:19:43 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-30 20:19:43 +0000
commit2d4942e36d8de1812ed7938ab5acd0baff6e9b56 (patch)
tree8fab94f219972bd86cc812464d8923fbff18f92b
parent99f66f04248896c4f95460b41b443a7b9b8fdd99 (diff)
downloadportage-2d4942e36d8de1812ed7938ab5acd0baff6e9b56.tar.gz
portage-2d4942e36d8de1812ed7938ab5acd0baff6e9b56.tar.bz2
portage-2d4942e36d8de1812ed7938ab5acd0baff6e9b56.zip
Make the use_cache=0 listdir() implementation inside vardbapi.cpv_all()
rains a PermissionDenied error when appropriate. svn path=/main/trunk/; revision=10505
-rw-r--r--pym/portage/dbapi/vartree.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 8f8926231..5c15393fb 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -471,7 +471,10 @@ class vardbapi(dbapi):
try:
return [x for x in os.listdir(p) \
if os.path.isdir(os.path.join(p, x))]
- except EnvironmentError:
+ except EnvironmentError, e:
+ if e.errno == PermissionDenied.errno:
+ raise PermissionDenied(p)
+ del e
return []
for x in listdir(basepath, EmptyOnError=1, ignorecvs=1, dirsonly=1):