summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-18 20:37:24 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-18 20:37:24 +0000
commite402103396709dabbb38f7ae0a6707fc6a0477f3 (patch)
treed5372324313621dec41d83aaca7b9a9d572cb542
parentd46eeafa99f68415d24b969424504d4c78325837 (diff)
downloadportage-e402103396709dabbb38f7ae0a6707fc6a0477f3.tar.gz
portage-e402103396709dabbb38f7ae0a6707fc6a0477f3.tar.bz2
portage-e402103396709dabbb38f7ae0a6707fc6a0477f3.zip
Validate ebuild names inside portdbapi.cp_list() in order to prevent problems later on. Thanks to delusions for reporting on irc.
svn path=/main/trunk/; revision=5713
-rw-r--r--pym/portage.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 4acb1e201..69f636214 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6033,8 +6033,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):