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