Created attachment 332430 [details] Test program to show the issue I get an issue when which query.smart_find when passed dev-libs/libsigc++-2.2.11 I have attached a small test program to show the issue. The output is: Traceback (most recent call last): File "./test.py", line 15, in <module> packages = query.smart_find(True,True,True,True,False,True) File "/usr/lib64/python2.7/site-packages/gentoolkit/query.py", line 169, in smart_find matches = self._do_complex_lookup(show_progress=show_progress) File "/usr/lib64/python2.7/site-packages/gentoolkit/query.py", line 333, in _do_complex_lookup result = [x for x in pre_filter if predicate(x)] File "/usr/lib64/python2.7/site-packages/gentoolkit/query.py", line 325, in <lambda> predicate = lambda x: re.search(self.query, x) File "/usr/lib64/python2.7/re.py", line 142, in search return _compile(pattern, flags).search(string) File "/usr/lib64/python2.7/re.py", line 242, in _compile raise error, v # invalid expression sre_constants.error: multiple repeat
It works if you change: query = Query(package_name, True) to query = Query(package_name, False) However, I see that it raises an InvalidCPV exception if you set it to True and pass a valid regular expression. So it is definitely seems like it is not working like it supposed to.
This is fixed in the following commit. http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=de264bbe75fe45ff7d457343a8a8a5f96cd14a7f Note: If you tell smart_find to do a regular expression search, you do need to make sure you pass a valid regular expression or it will raise a GentoolkitInvalidRegex exception.
Mike, with reference to your message on the forums I don't know if we've hit the same problem, but I ran some rough tests on equery by attaching the Python code below to gentoolkit's cpv.py, and the combination of '*" and '-' produced the "Invalid CPV error". (This was under Python 2.7). Running the code under winpdb I can see the call to split_cpv treating the '-' as a package name/version separator, and then returning an invalid name response from isvalid_pkg_name, but my Python isn't up to digging deeper. Interestingly, the formal tests in test_cpv.py mention a problem with '-', not including '*', and a bug report 316961. I get the same result however I try reconfiguring the regexp. # # Rough test of cpv.py - attach the code to the end of cpv.py # def main(argv=None): print "main() running" # Sample tests from cpv.py cpv = CPV('sys-apps/portage-2.2-r1') print cpv.category, cpv.name, cpv.fullversion # 'sys-apps portage 2.2-r1' print str(cpv) # 'sys-apps/portage-2.2-r1' # Local tests. cpv = CPV('x11-libs/qt-meta-4.8') print cpv.category, cpv.name, cpv.fullversion print str(cpv) cpv = CPV('*qt*') print cpv.category, cpv.name, cpv.fullversion print str(cpv) cpv = CPV('*qt-meta*') print cpv.category, cpv.name, cpv.fullversion print str(cpv) return 0 if __name__ == "__main__": sys.exit(main()) # eof
I confirm that gentoolkit-9999 does not crash over dev-libs/libsigc++ anymore. What remains is another problem already mentioned in bug 445502, portpeek now reads ~dev-libs/libsigc++-2.2.11 and lists it as 'Not Installed', while in fact it is. Back with gentoolkit-0.3.0.7, changing ~ to = solved the problem - I didn't try that out yet as portpeek is still running: Queries seem to take much, much longer with gentoolkit-9999 right now, I've already had three cups of coffee in the meantime.
Released in gentoolkit-0.3.0.8