From b54b8cf406259b4f95ef4cf93b63d52d29c81056 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 16 May 2008 21:41:01 +0000 Subject: Detect and filter ebuilds that have invalid versions in portdbapi.cp_list(). svn path=/main/trunk/; revision=10346 --- pym/portage/dbapi/porttree.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pym') diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 3c287a7d6..70135be34 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -14,7 +14,7 @@ from portage.exception import OperationNotPermitted, PortageException, \ from portage.manifest import Manifest from portage.output import red from portage.util import ensure_dirs, writemsg, apply_recursive_permissions -from portage.versions import pkgcmp, pkgsplit, catpkgsplit, best +from portage.versions import pkgcmp, pkgsplit, catpkgsplit, best, ver_regexp import portage.gpg, portage.checksum @@ -556,6 +556,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 " + \ -- cgit v1.2.3-1-g7c22