summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-30 04:31:03 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-30 04:31:03 +0000
commit6ddb43d4cefac01b12ce9d2655b36180a8932acb (patch)
tree86336838fdd778923bb9e2bdf44482fad6894b8b /pym/portage.py
parent0a7b011b785a0f8f67f770eabf6eae9d4f22707d (diff)
downloadportage-6ddb43d4cefac01b12ce9d2655b36180a8932acb.tar.gz
portage-6ddb43d4cefac01b12ce9d2655b36180a8932acb.tar.bz2
portage-6ddb43d4cefac01b12ce9d2655b36180a8932acb.zip
For bug #180165, make portageq print a "Permission denied" error when appropriate and make has_version die if portageq has an unexpected exit code. (branches/2.1.2 r6885)
svn path=/main/branches/2.1.2.9/; revision=7470
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 2a153a298..2ee843c2b 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -185,7 +185,14 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli
mtime = pathstat[stat.ST_MTIME]
else:
raise portage_exception.DirectoryNotFound(mypath)
- except (IOError,OSError,portage_exception.PortageException):
+ except EnvironmentError, e:
+ if e.errno == portage_exception.PermissionDenied.errno:
+ raise portage_exception.PermissionDenied(mypath)
+ del e
+ if EmptyOnError:
+ return [], []
+ return None, None
+ except portage_exception.PortageException:
if EmptyOnError:
return [], []
return None, None
@@ -199,8 +206,6 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli
if e.errno != errno.EACCES:
raise
del e
- if EmptyOnError:
- return [], []
raise portage_exception.PermissionDenied(mypath)
ftype = []
for x in list: