From: fuzzyray Date: Fri, 22 Aug 2008 20:14:08 +0000 (-0000) Subject: Fix equery belongs to strip multiple slashes from path names. (Bug #234584) X-Git-Tag: gentoolkit-0.2.4.3~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=efd5f95aeb46a041c86bcc0a23490bbeb9c9341b;p=gentoolkit.git Fix equery belongs to strip multiple slashes from path names. (Bug #234584) svn path=/; revision=505 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 4ec5c13..17124b6 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2008-08-22: Paul Varner + * equery: Fix equery belongs to strip multiple slashes from path + names. (Bug #234584) + 2008-07-24: Paul Varner * equery: Fix equery check to convert mtime to an integer so that comparisions always work. Thanks to Alexey Parshin for discovering the diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index ed8c5c4..63eb8b3 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -369,12 +369,13 @@ class CmdListBelongs(Command): if opts["fullRegex"]: q = query else: - # Trim trailing slash from query + # Trim trailing and multiple slashes from query for i in range(0, len(query)): - if (query[i][-1] == "/"): - query[i] = query[i][:-1] + query[i] = re.compile('/+').sub('/', query[i]) + query[i] = query[i].rstrip('/') q = map(lambda x: ((len(x) and x[0] == "/") and "^" or "/") + re.escape(x) + "$", query) + print q try: q = "|".join(q) rx = re.compile(q)