diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-17 23:25:57 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-17 23:25:57 +0000 |
commit | bb1e53a7a8f8e01a122389c3d143055bbe1f1402 (patch) | |
tree | 95e1946f09482f3ee2c64cc35efa35d6fa1d7e11 /pym | |
parent | fa97d9e6471dd45e1b12811e91baa5dfae425335 (diff) | |
download | portage-bb1e53a7a8f8e01a122389c3d143055bbe1f1402.tar.gz portage-bb1e53a7a8f8e01a122389c3d143055bbe1f1402.tar.bz2 portage-bb1e53a7a8f8e01a122389c3d143055bbe1f1402.zip |
Detect and filter ebuilds that have invalid versions in portdbapi.cp_list().
(trunk r10346)
svn path=/main/branches/2.1.2/; revision=10353
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py index 3947db8cd..5a6d33c8b 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -7703,6 +7703,7 @@ class portdbapi(dbapi): mytrees = [mytree] else: mytrees = self.porttrees + from portage_versions import ver_regexp for oroot in mytrees: try: file_list = os.listdir(os.path.join(oroot, mycp)) @@ -7720,6 +7721,11 @@ class portdbapi(dbapi): writemsg("\nInvalid ebuild name: %s\n" % \ os.path.join(oroot, mycp, x), noiselevel=-1) continue + ver_match = ver_regexp.match("-".join(ps[1:])) + if ver_match is None or not ver_match.groups(): + writemsg("\nInvalid ebuild version: %s\n" % \ + os.path.join(oroot, mycp, x), noiselevel=-1) + continue d[mysplit[0]+"/"+pf] = None if invalid_category and d: writemsg(("\n!!! '%s' has a category that is not listed in " + \ |