summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-10 20:36:10 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-10 20:36:10 +0000
commit24db0fb98b41245b52306f45a6d4c381caa94255 (patch)
treee5250cb88c449ae9ff5a74717163ce8e5b9de01d
parent8a5bafa0dcb3d00b2662ad82f66f634af894a30a (diff)
downloadportage-24db0fb98b41245b52306f45a6d4c381caa94255.tar.gz
portage-24db0fb98b41245b52306f45a6d4c381caa94255.tar.bz2
portage-24db0fb98b41245b52306f45a6d4c381caa94255.zip
Add an allow_blockers parameter to isvalidatom so that the behavior is optional. Thanks to Brian Harring for the suggestion.
svn path=/main/trunk/; revision=5264
-rwxr-xr-xbin/repoman2
-rw-r--r--pym/portage_dep.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/bin/repoman b/bin/repoman
index 2710f66ca..a3a8d96e7 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1103,7 +1103,7 @@ for x in scanlist:
if token in operator_tokens or \
token.endswith("?"):
continue
- if not portage.isvalidatom(token) or \
+ if not portage.isvalidatom(token, allow_blockers=True) or \
":" in token and myaux["EAPI"] == "0":
badsyntax.append("'%s' not a valid atom" % token)
diff --git a/pym/portage_dep.py b/pym/portage_dep.py
index f284ae73a..7a4d76aae 100644
--- a/pym/portage_dep.py
+++ b/pym/portage_dep.py
@@ -313,7 +313,7 @@ def dep_getslot(mydep):
_invalid_atom_chars_regexp = re.compile("[()|?]")
-def isvalidatom(atom):
+def isvalidatom(atom, allow_blockers=False):
"""
Check to see if a depend atom is valid
@@ -333,7 +333,7 @@ def isvalidatom(atom):
global _invalid_atom_chars_regexp
if _invalid_atom_chars_regexp.search(atom):
return 0
- if atom.startswith("!"):
+ if allow_blockers and atom.startswith("!"):
atom = atom[1:]
mycpv_cps = catpkgsplit(dep_getcpv(atom))
operator = get_operator(atom)