diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-16 21:41:01 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-16 21:41:01 +0000 |
commit | b54b8cf406259b4f95ef4cf93b63d52d29c81056 (patch) | |
tree | eb9df8c2276b1d4177ff8ab22bc4a986afeb4932 | |
parent | 9adda5eda6e7b9cafecbbd7ce41ed77ae1d4e500 (diff) | |
download | portage-b54b8cf406259b4f95ef4cf93b63d52d29c81056.tar.gz portage-b54b8cf406259b4f95ef4cf93b63d52d29c81056.tar.bz2 portage-b54b8cf406259b4f95ef4cf93b63d52d29c81056.zip |
Detect and filter ebuilds that have invalid versions in portdbapi.cp_list().
svn path=/main/trunk/; revision=10346
-rw-r--r-- | pym/portage/dbapi/porttree.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 " + \ |