diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-05 18:42:13 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-05 18:42:13 +0000 |
commit | 61af83b0855f9ea2b5dc5f1a1342eef7faa4953b (patch) | |
tree | 32848c7443803f8189943e67495691b4537740ab | |
parent | 28393545f3fcaedcd38f6c4f4256d2ca29cf798b (diff) | |
download | portage-61af83b0855f9ea2b5dc5f1a1342eef7faa4953b.tar.gz portage-61af83b0855f9ea2b5dc5f1a1342eef7faa4953b.tar.bz2 portage-61af83b0855f9ea2b5dc5f1a1342eef7faa4953b.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()
(trunk r10204)
svn path=/main/branches/2.1.2/; revision=10205
-rw-r--r-- | pym/portage.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pym/portage.py b/pym/portage.py index 176a21dbe..0f8a393cd 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6726,13 +6726,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 + 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): |