From 1433cbab0ce2788580086eefc5c3b97384ea4ec7 Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Sat, 5 Nov 2005 05:33:53 +0000 Subject: [PATCH] Fix equery belongs to work with multiple files - Bug 111501 svn path=/; revision=253 --- trunk/ChangeLog | 4 ++++ trunk/src/equery/equery | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 39c8104..76821b4 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2005-11-04 Paul Varner + * equery: Fix equery belongs to correctly work when passed an argument + list of multiple files (Bug 111501) + 2005-11-02 Paul Varner * revdep-rebuild: Fix to work with findutils-4.2.25 (Bug 111203) 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") -- 2.26.2