diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-09-12 14:59:04 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-09-12 14:59:04 +0000 |
commit | ec4bcdafd6edb360be7ee309dbeff60977113be5 (patch) | |
tree | 69418580981a9446d5a8b595526b923f883dd676 | |
parent | 09b838290bec5e5cba678c88fe158e4b44ac0514 (diff) | |
download | portage-ec4bcdafd6edb360be7ee309dbeff60977113be5.tar.gz portage-ec4bcdafd6edb360be7ee309dbeff60977113be5.tar.bz2 portage-ec4bcdafd6edb360be7ee309dbeff60977113be5.zip |
Bug #192298 - Handle PermissionDenied error in cache.update_eclasses().
svn path=/main/trunk/; revision=7769
-rw-r--r-- | pym/portage/eclass_cache.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pym/portage/eclass_cache.py b/pym/portage/eclass_cache.py index 5a0d3c3ad..6e4eebd18 100644 --- a/pym/portage/eclass_cache.py +++ b/pym/portage/eclass_cache.py @@ -4,8 +4,9 @@ # $Id$ from portage.util import normalize_path, writemsg -import os, sys +import errno, os, sys from portage.data import portage_gid +from portage.exception import PermissionDenied class cache(object): """ @@ -44,7 +45,19 @@ class cache(object): for x in [normalize_path(os.path.join(y,"eclass")) for y in self.porttrees]: if not os.path.isdir(x): continue - for y in [y for y in os.listdir(x) if y.endswith(".eclass")]: + eclass_filenames = [] + try: + for y in os.listdir(x): + if y.endswith(".eclass"): + eclass_filenames.append(y) + except OSError, e: + if e.errno == errno.ENOENT: + del e + continue + elif e.errno == PermissionDenied.errno: + raise PermissionDenied(x) + raise + for y in eclass_filenames: try: mtime = long(os.stat(os.path.join(x, y)).st_mtime) except OSError: |