diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-01-18 20:54:40 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-01-18 20:54:40 +0000 |
commit | c22f2f0be29e3647914ca1dc88af1648db41d674 (patch) | |
tree | 72a5fc5dc26a9732cd5fa6005654489a789d63c9 /pym/portage.py | |
parent | 507274cca8e233e5a6f052d50509bd3cf1f719ff (diff) | |
download | portage-c22f2f0be29e3647914ca1dc88af1648db41d674.tar.gz portage-c22f2f0be29e3647914ca1dc88af1648db41d674.tar.bz2 portage-c22f2f0be29e3647914ca1dc88af1648db41d674.zip |
Validate ebuild names in portdbapi.cp_list() and raise an raise an informative InvalidData exception from match_from_list when necessary. (trunk r5712:5714)
svn path=/main/branches/2.1.2/; revision=5715
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py index 53eac070a..92463ea97 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5968,8 +5968,14 @@ class portdbapi(dbapi): mytrees = self.porttrees for oroot in mytrees: for x in listdir(oroot+"/"+mycp,EmptyOnError=1,ignorecvs=1): - if x[-7:]==".ebuild": - d[mysplit[0]+"/"+x[:-7]] = None + if x.endswith(".ebuild"): + pf = x[:-7] + ps = pkgsplit(pf) + if not ps: + writemsg("\nInvalid ebuild name: %s\n" % \ + os.path.join(oroot, mycp, x), noiselevel=-1) + continue + d[mysplit[0]+"/"+pf] = None return d.keys() def freeze(self): |