1 |
On 18/02/18 21:27, Zac Medico wrote: |
2 |
> Since search strings containing a slash do no work unless category |
3 |
> match mode is enabled, use slash to auto-detect category match mode, |
4 |
> so that users do not have to prefix the search string with the special |
5 |
> @ symbol. |
6 |
> |
7 |
> Bug: https://bugs.gentoo.org/647940 |
8 |
> --- |
9 |
> pym/_emerge/search.py | 4 ++++ |
10 |
> 1 file changed, 4 insertions(+) |
11 |
> |
12 |
> diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py |
13 |
> index 36897fb15..eb52b2ca3 100644 |
14 |
> --- a/pym/_emerge/search.py |
15 |
> +++ b/pym/_emerge/search.py |
16 |
> @@ -256,6 +256,10 @@ class search(object): |
17 |
> if self.searchkey.startswith('@'): |
18 |
> match_category = 1 |
19 |
> self.searchkey = self.searchkey[1:] |
20 |
> + # Auto-detect category match mode (@ symbol can be deprecated |
21 |
> + # after this is available in a stable version of portage). |
22 |
> + if '/' in self.searchkey: |
23 |
> + match_category = 1 |
24 |
> fuzzy = False |
25 |
> if regexsearch: |
26 |
> self.searchre=re.compile(self.searchkey,re.I) |
27 |
+1 long overdue! :D |