Make the use_cache=0 listdir() implementation inside vardbapi.cpv_all()
authorZac Medico <zmedico@gentoo.org>
Fri, 30 May 2008 20:24:08 +0000 (20:24 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 30 May 2008 20:24:08 +0000 (20:24 -0000)
raise a PermissionDenied error when appropriate. (trunk r10505)

svn path=/main/branches/2.1.2/; revision=10506

pym/portage.py

index 812aaaa5a21b9f0fcfbc94343cd46dc982ae9dcc..557d27880175662927a00e1647ff85cb78630116 100644 (file)
@@ -6802,7 +6802,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 == portage_exception.PermissionDenied.errno:
+                                               raise portage_exception.PermissionDenied(p)
+                                       del e
                                        return []
 
                for x in listdir(basepath, EmptyOnError=1, ignorecvs=1, dirsonly=1):