diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-05 18:40:49 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-05 18:40:49 +0000 |
commit | cc00dc9e2e5a0369580c87a6da72f71e863cdb02 (patch) | |
tree | f4189546246cc4049ea33b41992575808521c8d9 | |
parent | efb47ddf161e122101dc2ce3ab032db347b4d243 (diff) | |
download | portage-cc00dc9e2e5a0369580c87a6da72f71e863cdb02.tar.gz portage-cc00dc9e2e5a0369580c87a6da72f71e863cdb02.tar.bz2 portage-cc00dc9e2e5a0369580c87a6da72f71e863cdb02.zip |
* In vardbapi.cpv_all() use catpkgsplit() for validation since that's what
with cp_all() uses.
* Use the listdir() dirsonly=1 parameter to avoid unnecessary stat calls
via os.path.isdir().
svn path=/main/trunk/; revision=10204
-rw-r--r-- | pym/portage/dbapi/vartree.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index b12a1993a..34b8def7b 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -460,13 +460,19 @@ class vardbapi(dbapi): continue if not self._category_re.match(x): continue - for y in listdir(basepath + x, EmptyOnError=1): + for y in listdir(basepath + x, EmptyOnError=1, dirsonly=1): if self._excluded_dirs.match(y) is not None: continue subpath = x + "/" + y # -MERGING- should never be a cpv, nor should files. - if os.path.isdir(basepath + subpath) and (pkgsplit(y) is not None): - returnme += [subpath] + try: + if catpkgsplit(subpath) is None: + self.invalidentry(os.path.join(self.root, subpath)) + continue + except portage.exception.InvalidData: + self.invalidentry(os.path.join(self.root, subpath)) + continue + returnme.append(subpath) return returnme def cp_all(self, use_cache=1): |