summaryrefslogtreecommitdiff
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
parent8b380ec5e61e5ac90ee58011b9965a9952bbfad4 (diff)
downloadgentoolkit-1433cbab0ce2788580086eefc5c3b97384ea4ec7.tar.gz
Fix equery belongs to work with multiple files - Bug 111501
svn path=/; revision=253
-rw-r--r--trunk/ChangeLog4
-rwxr-xr-xtrunk/src/equery/equery14
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 <fuzzyray@gentoo.org>
+ * equery: Fix equery belongs to correctly work when passed an argument
+ list of multiple files (Bug 111501)
+
2005-11-02 Paul Varner <fuzzyray@gentoo.org>
* 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")