From bb1e53a7a8f8e01a122389c3d143055bbe1f1402 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 17 May 2008 23:25:57 +0000 Subject: [PATCH] Detect and filter ebuilds that have invalid versions in portdbapi.cp_list(). (trunk r10346) svn path=/main/branches/2.1.2/; revision=10353 --- pym/portage.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 " + \ -- 2.26.2