aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-09-27 20:59:16 +0000
committerZac Medico <zmedico@gentoo.org>2007-09-27 20:59:16 +0000
commitf1807ce4ae481d99bcac1655e8f8d5f2cb280212 (patch)
tree41e45a42ef935d826f40c9787ece9716b1e492be /pym/portage/eclass_cache.py
parentMove a newline to fix formatting. (diff)
downloadportage-f1807ce4ae481d99bcac1655e8f8d5f2cb280212.tar.gz
portage-f1807ce4ae481d99bcac1655e8f8d5f2cb280212.tar.bz2
portage-f1807ce4ae481d99bcac1655e8f8d5f2cb280212.zip
Simplify update_eclasses() a little.
svn path=/main/trunk/; revision=7861
Diffstat (limited to 'pym/portage/eclass_cache.py')
-rw-r--r--pym/portage/eclass_cache.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/pym/portage/eclass_cache.py b/pym/portage/eclass_cache.py
index 8fac8aec4..806505757 100644
--- a/pym/portage/eclass_cache.py
+++ b/pym/portage/eclass_cache.py
@@ -42,23 +42,20 @@ class cache(object):
self.eclasses = {}
self._eclass_locations = {}
eclass_len = len(".eclass")
+ ignored_listdir_errnos = (errno.ENOENT, errno.ENOTDIR)
for x in [normalize_path(os.path.join(y,"eclass")) for y in self.porttrees]:
- eclass_filenames = []
try:
- for y in os.listdir(x):
- if y.endswith(".eclass"):
- eclass_filenames.append(y)
+ eclass_filenames = os.listdir(x)
except OSError, e:
- if e.errno == errno.ENOENT:
- del e
- continue
- elif e.errno == errno.ENOTDIR:
+ if e.errno in ignored_listdir_errnos:
del e
continue
elif e.errno == PermissionDenied.errno:
raise PermissionDenied(x)
raise
for y in eclass_filenames:
+ if not y.endswith(".eclass"):
+ continue
try:
mtime = long(os.stat(os.path.join(x, y)).st_mtime)
except OSError: