summaryrefslogtreecommitdiffstats
path: root/pym/portage_dep.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-09 20:13:04 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-09 20:13:04 +0000
commit4ba23115b68d6bdce4d83c27c882013bbd918199 (patch)
tree31680821d5d08fa8b9ceb44e062089c7f0785ae6 /pym/portage_dep.py
parent9289a8996757b2645e5a93b8a14300beca8149d0 (diff)
downloadportage-4ba23115b68d6bdce4d83c27c882013bbd918199.tar.gz
portage-4ba23115b68d6bdce4d83c27c882013bbd918199.tar.bz2
portage-4ba23115b68d6bdce4d83c27c882013bbd918199.zip
Make isvalidatom() (and thus repoman) reject atoms containing |() characters. Thanks to Brian Harring for the suggestion.
svn path=/main/trunk/; revision=5241
Diffstat (limited to 'pym/portage_dep.py')
-rw-r--r--pym/portage_dep.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage_dep.py b/pym/portage_dep.py
index 413e87cbb..f0f272787 100644
--- a/pym/portage_dep.py
+++ b/pym/portage_dep.py
@@ -18,7 +18,7 @@
# "a? ( b? ( z ) ) -- Valid
#
-import os,string,types,sys,copy
+import re, string, sys, types
import portage_exception
from portage_versions import catpkgsplit, catsplit, pkgcmp, pkgsplit, ververify
@@ -303,6 +303,8 @@ def dep_getslot(mydep):
return mydep[colon+1:]
return None
+_invalid_atom_chars_regexp = re.compile("[()|]")
+
def isvalidatom(atom):
"""
Check to see if a depend atom is valid
@@ -320,6 +322,9 @@ def isvalidatom(atom):
1) 0 if the atom is invalid
2) 1 if the atom is valid
"""
+ global _invalid_atom_chars_regexp
+ if _invalid_atom_chars_regexp.search(atom):
+ return 0
mycpv_cps = catpkgsplit(dep_getcpv(atom))
operator = get_operator(atom)
if operator: