Fix equery belongs to work with multiple files - Bug 111501
authorfuzzyray <fuzzyray@gentoo.org>
Sat, 5 Nov 2005 05:33:53 +0000 (05:33 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Sat, 5 Nov 2005 05:33:53 +0000 (05:33 -0000)
svn path=/; revision=253

trunk/ChangeLog
trunk/src/equery/equery

index 39c810429c65f8c6661ca4cc32813af4f2c8c71c..76821b4ca5df76dd977855ed776ea69bab6a40e4 100644 (file)
@@ -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)
 
index 1b2c3b025751e2a696300f12c69f65f738a4f165..045747dd98d0d0ac48d9385f5d77ec0c32b7e88c 100755 (executable)
@@ -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")