summaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
authorfuzzyray <fuzzyray@gentoo.org>2005-11-05 05:33:53 +0000
committerfuzzyray <fuzzyray@gentoo.org>2005-11-05 05:33:53 +0000
commit1433cbab0ce2788580086eefc5c3b97384ea4ec7 (patch)
treee1de8cb14417d3b83e6dd1fd903ec3908c8f5256 /trunk/src
parent8b380ec5e61e5ac90ee58011b9965a9952bbfad4 (diff)
downloadgentoolkit-1433cbab0ce2788580086eefc5c3b97384ea4ec7.tar.gz
Fix equery belongs to work with multiple files - Bug 111501
svn path=/; revision=253
Diffstat (limited to 'trunk/src')
-rwxr-xr-xtrunk/src/equery/equery14
1 files changed, 7 insertions, 7 deletions
diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery
index 1b2c3b0..045747d 100755
--- a/trunk/src/equery/equery
+++ b/trunk/src/equery/equery
@@ -319,14 +319,14 @@ class CmdListBelongs(Command):
def perform(self, args):
(query, opts) = self.parseArgs(args)
+ if opts["fullRegex"]:
+ q = query
+ else:
+ q = map(lambda x: ((len(x) and x[0] == "/") and "^" or "/")
+ + re.escape(x) + "$", query)
try:
- q = string.join(query, "|")
- if opts["fullRegex"]:
- rx = re.compile(q)
- elif len(q) and q[0] == "/":
- rx = re.compile("^" + re.escape(q) + "$")
- else:
- rx = re.compile("/" + re.escape(q) + "$")
+ q = string.join(q, "|")
+ rx = re.compile(q)
except:
die(2, "The query '" + pp.regexpquery(q) + "' does not appear to be a valid regular expression")