From 15e8f08e0ec79cb0f732c3b065d811eaa6019c42 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 9 Dec 2006 20:34:45 +0000 Subject: [PATCH] Clean up depstring/atom splitting and filtering. svn path=/main/trunk/; revision=5243 --- bin/repoman | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/repoman b/bin/repoman index 451bd21d0..2710f66ca 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1062,6 +1062,7 @@ for x in scanlist: myflag = myflag[1:] myiuse.add(myflag) + operator_tokens = set(["||", "(", ")"]) type_list, badsyntax = [], [] for mytype in ("DEPEND", "RDEPEND", "PDEPEND", "LICENSE", "PROVIDE"): mydepstr = myaux[mytype] @@ -1084,7 +1085,7 @@ for x in scanlist: except portage_exception.InvalidDependString, e: badsyntax.append(str(e)) - for token in ("||", "(", ")"): + for token in operator_tokens: if mydepstr.startswith(token+" "): myteststr = mydepstr[len(token):] else: @@ -1098,7 +1099,10 @@ for x in scanlist: if mytype in ("DEPEND", "RDEPEND", "PDEPEND"): - for token in filter(lambda x: not (x.endswith("?") or x.strip() in ("||", "&&", "(", ")")), mydepstr.split()): + for token in mydepstr.split(): + if token in operator_tokens or \ + token.endswith("?"): + continue if not portage.isvalidatom(token) or \ ":" in token and myaux["EAPI"] == "0": badsyntax.append("'%s' not a valid atom" % token) -- 2.26.2